summaryrefslogtreecommitdiffstats
path: root/roles/ands_network/tasks/firewall_service.yml
blob: 98bc86654f2fa130667c8e48c671b540abb8ade1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
- name: "Copy firewalld service '{{ service }}'"
  copy: src="{{ 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 | 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 | changed)