dotfiles/salt/states/firewalld.sls

24 lines
738 B
Plaintext
Raw Normal View History

2020-08-14 09:27:53 +00:00
{% if pillar['firewalld']['services'] is defined %}
{% for service, args in pillar['firewalld']['services'].items() %}
Adding {{ service }} firewalld service:
firewalld.service:
- name: {{ service }}
- ports: {{ args['ports'] }}
{% endfor %}
{% endif %}
{% if pillar['firewalld']['zones'] is defined %}
{% for zone, args in pillar['firewalld']['zones'].items() %}
configure {{ zone }} firewalld zone:
firewalld.present:
- name: {{ zone }}
- default: {{ args['default'] if args['default'] is defined else False }}
{% if args['services'] is defined %}
- services:
{% for service, args in args['services'].items() -%}
- {{ service }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}