Browse Source

Fix service name for xenial and newer distributions using netfilter

tags/mcp0.5
Filip Pytloun 7 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

{% set service = salt['grains.filter_by']({ {% set service = salt['grains.filter_by']({
'Debian': { 'Debian': {
'pkgs': ['iptables','iptables-persistent' ], 'pkgs': ['iptables','iptables-persistent' ],
'service': 'iptables-persistent',
'service': 'netfilter-persistent',
}, },
'RedHat': { 'RedHat': {
'pkgs': ['iptables'], 'pkgs': ['iptables'],
'service': '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

- names: {{ service.pkgs }} - names: {{ service.pkgs }}


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

Loading…
Cancel
Save