---
- name: Save iptables rules
  shell: iptables-save > /etc/sysconfig/iptables
  become: yes

- name: Restore iptables rules
  command: iptables-restore
  become: yes

- name: Restart ipsec
  service:
    name: ipsec
    state: restarted
  become: yes

- name: Listen for IPSEC connections
  shell: ipsec whack --listen
  become: yes
  ignore_errors: true
  when:
  - inventory_hostname in groups['pacemaker']
