added firewalld pillars and state
This commit is contained in:
parent
7b5e31aec7
commit
54e03c14f9
10
salt/pillars/firewalld/init.sls
Normal file
10
salt/pillars/firewalld/init.sls
Normal file
@ -0,0 +1,10 @@
|
||||
include:
|
||||
- firewalld.kde-connect
|
||||
|
||||
firewalld:
|
||||
zones:
|
||||
public:
|
||||
default: True
|
||||
services:
|
||||
ssh:
|
||||
dhcpv6-client:
|
10
salt/pillars/firewalld/kde-connect.sls
Normal file
10
salt/pillars/firewalld/kde-connect.sls
Normal file
@ -0,0 +1,10 @@
|
||||
firewalld:
|
||||
services:
|
||||
kde-connect:
|
||||
ports:
|
||||
- 1714-1764/tcp
|
||||
- 1714-1764/udp
|
||||
zones:
|
||||
public:
|
||||
services:
|
||||
kde-connect:
|
@ -5,6 +5,7 @@ base:
|
||||
- firefox
|
||||
- hosts
|
||||
- repos.google_chrome
|
||||
- firewalld
|
||||
{% if grains['os'] == "SUSE" -%}
|
||||
- repos.packman
|
||||
{% endif %}
|
||||
|
23
salt/states/firewalld.sls
Normal file
23
salt/states/firewalld.sls
Normal file
@ -0,0 +1,23 @@
|
||||
{% 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 %}
|
@ -6,3 +6,4 @@ base:
|
||||
- vim
|
||||
- firefox
|
||||
- sudo
|
||||
- firewalld
|
||||
|
Loading…
Reference in New Issue
Block a user