iptables save fix for centos 7

Centos 7 use systemd, we cannot use service save iptables anymore.
iptables can be stopped and disabled so we just save rules in
/etc/sysconfig/iptables with iptables-save

Change-Id: I55342afadea29a1a07fe50f30e0371b3367c3d7a
Closes-Bug: 1831175
This commit is contained in:
Kourosh Vivan 2019-07-09 15:00:45 +02:00
parent a18639c4e8
commit 7b42151679

View File

@ -28,11 +28,10 @@
ignore_errors: yes
when: ansible_os_family == 'Debian'
- name: save iptables rules (CentOS & RHEL)
command: service iptables save
args:
warn: False # since we use save service module doesn't apply
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
- name: save iptables rules (CentOS)
shell: iptables-save > /etc/sysconfig/iptables
when:
- ansible_distribution == 'CentOS'
- name: Create certs directory
file: path=/etc/octavia/certs/ state=directory