summaryrefslogtreecommitdiffstats
path: root/roles/ands_network/tasks/firewall_service.yml
blob: 80612e7076dc7bd94c7dd0755265386b26e5cdb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
- name: "Copy firewalld service '{{ service }}'"
  copy: src="firewalld/{{ service }}.xml" dest="{{ firewall_template_path }}/{{ service }}.xml" owner=root group=root mode="0644"
  register: result

- name: "Delete old version of firewalld service '{{ service }}'"
  command: "firewall-offline-cmd  --remove-service={{ service }}"
  when: 
    - service in servicelist
    - result is changed
  
- name: "Create firewalld service '{{ service }}'"
  command: "firewall-offline-cmd --new-service-from-file='{{ firewall_template_path }}/{{ service }}.xml' --name={{ service }}"
  when: (service not in servicelist) or (result is changed)