Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: Fix iptables persistence after reboot #373

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kahou82
Copy link
Member

@kahou82 kahou82 commented Oct 11, 2017

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
@@ -26,14 +27,20 @@
yum: pkg={{ item }} state=present
with_items:
- iptables-services
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'
Copy link
Contributor

@tiewei tiewei Oct 11, 2017

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

@@ -1,3 +1,4 @@
[metacloud@mcp1 ansible]$ cat roles/etcd/tasks/main.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this ?

apt: name={{item}} state=installed
with_items:
- iptables-persistent
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'

- name: Enable iptables service
command: systemctl enable iptables
Copy link
Contributor

@tiewei tiewei Oct 11, 2017

Choose a reason for hiding this comment

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

use service module instead

command: systemctl enable iptables

- name: Start iptables service
command: systemctl start iptables
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -45,10 +51,10 @@
- "{{ etcd_peer_port1 }}"
- "{{ etcd_peer_port2 }}"

# 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
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