Browse Source

Fix service name for xenial and newer distributions using netfilter

tags/mcp0.5
Filip Pytloun 8 years ago
parent
commit
23030090ac
2 changed files with 10 additions and 2 deletions
  1. +6
    -2
      iptables/map.jinja
  2. +4
    -0
      iptables/service.sls

+ 6
- 2
iptables/map.jinja View File

@@ -2,10 +2,14 @@
{% set service = salt['grains.filter_by']({
'Debian': {
'pkgs': ['iptables','iptables-persistent' ],
'service': 'iptables-persistent',
'service': 'netfilter-persistent',
},
'RedHat': {
'pkgs': ['iptables'],
'service': 'iptables',
},
}, merge=salt['pillar.get']('iptables:service')) %}
}, merge=salt['grains.filter_by']({
'trusty': {
'service': 'iptables-persistent',
},
}, grain='oscodename', merge=salt['pillar.get']('iptables:service'))) %}

+ 4
- 0
iptables/service.sls View File

@@ -10,7 +10,11 @@ iptables_packages:
- names: {{ service.pkgs }}

iptables_services:
{%- if grains.init == 'systemd' %}
service.running:
{%- else %}
service.dead:
{%- endif %}
- enable: true
- name: {{ service.service }}
- sig: test -e /etc/iptables/rules.v4

Loading…
Cancel
Save