Skip to content

DO NOT MERGE: Fix iptables persistence after reboot - #373

Open
kahou82 wants to merge 2 commits into
contiv:masterfrom
kahou82:CNTV-75
Open

DO NOT MERGE: Fix iptables persistence after reboot#373
kahou82 wants to merge 2 commits into
contiv:masterfrom
kahou82:CNTV-75

Conversation

@kahou82

@kahou82 kahou82 commented Oct 11, 2017

Copy link
Copy Markdown
Member

Currently, etcd iptables rule doesn't persist after reboot. This is
because we have to enable the iptables service. Otherwise, iptables
service will not load after reboot

Currently, etcd iptables rule doesn't persist after reboot. This is
because we have to enable the iptables service. Otherwise, iptables
service will not load after reboot
Comment thread roles/etcd/tasks/main.yml
with_items:
- iptables-services
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'

@tiewei tiewei Oct 11, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be able to use ansible_os_family instead

Comment thread roles/etcd/tasks/main.yml Outdated
@@ -1,3 +1,4 @@
[metacloud@mcp1 ansible]$ cat roles/etcd/tasks/main.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this ?

Comment thread roles/etcd/tasks/main.yml
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- name: Enable iptables service
command: systemctl enable iptables

@tiewei tiewei Oct 11, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use service module instead

Comment thread roles/etcd/tasks/main.yml
command: systemctl enable iptables

- name: Start iptables service
command: systemctl start iptables

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment thread roles/etcd/tasks/main.yml
# Save rules into /etc/sysconfig/iptables file for restoring rules on boot
# Save rules into /etc/sysconfig/iptables file for restoring rules on boot
- name: Save iptables
command: service iptables save

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use systemctl instead ... , but this may still work on older version of rhel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants