---
  # "Apply firewall rules."
  
  - name: "Install the main firewall script."
    copy:
       src: rc.firewall
       dest: /etc/rc.firewall
       owner: root
       group: root
       mode: 0550
    notify: "restart firewall"
  
  - name: "Install the firewall.input_early script (opens HTTPS ports for multiple FWD services)."
    copy:
       src: rc.firewall.input_early
       dest: /etc/rc.firewall.input_early
       owner: root
       group: root
       mode: 0550
    notify: "restart firewall"
  
  - name: "Install the rc.local script which will execute rc.firewall at boot."
    copy:
       src: rc.local
       dest: /etc/rc.local
       owner: root
       group: root
       mode: 0755

  - name: "Ensure the {{ fwd_srv_hostname }} is targeted by the iface IP, and not loopback, in /etc/hosts"
    lineinfile:
       dest: /etc/hosts
       regexp: '.*{{ item }}$' 
       line: "{{ hostvars[item].ansible_default_ipv4.address }} {{item}}"
       state: present
    with_items: "{{ groups.all }}"
