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

cluster role: open ports using firewall plugin #36

Merged
merged 1 commit into from
May 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions roles/cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
- name: Add local-port to xapi-clusterd service file
lineinfile:
path: /usr/lib/systemd/system/xapi-clusterd.service
regexp: '^ExecStart=/usr/sbin/xapi-clusterd$'
regexp: '^ExecStart=/usr/sbin/xapi-clusterd'
line: 'ExecStart=/usr/sbin/xapi-clusterd --local_port 8895'

- name: Open port 8895 in the firewall
lineinfile:
path: /etc/sysconfig/iptables
insertafter: '-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 8896 -j ACCEPT'
line: '-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 8895 -j ACCEPT'

- name: Restart iptables to pick up the new rule
systemd: state=restarted enabled=yes name=iptables
- name: Open port 8895 and 8896 in the firewall
command: "/etc/xapi.d/plugins/firewall-port open {{ item }}"
with_items:
- 8895
- 8896

# Note: if upgrading a live system would need to stop the cluster or at least disable fencing first
- name: Run xapi-clusterd
Expand All @@ -27,6 +24,3 @@
# provisioning after a reboot
- name: Sync
command: sync

- name: Sync2
command: sync