Skip to content

Commit be9e2cc

Browse files
committed
Check for neutron rules before flushing
1 parent 0a3e2fc commit be9e2cc

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

etc/kayobe/ansible/fixes/flush-iptables-legacy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
ansible.builtin.meta: end_host
1616
when: "'kolla-neutron_openvswitch_agent-container.service' not in ansible_facts.services"
1717

18+
- name: Check if neutron legacy iptables rules exist
19+
ansible.builtin.shell: |
20+
set -euo pipefail
21+
{{ container_engine }} exec -u root neutron_openvswitch_agent iptables-legacy-save | grep neutron
22+
register: save_result
23+
args:
24+
executable: /bin/bash
25+
26+
- name: End play for hosts wheere legacy-iptables is not in use by neutron
27+
ansible.builtin.meta: end_host
28+
when: save_result.rc != 0
29+
1830
- name: Flush iptables-legacy in neutron_openvswitch_agent container
1931
ansible.builtin.shell: |
2032
set -euo pipefail

0 commit comments

Comments
 (0)