Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save natalia-chikina/1b347e8856045abe024a1082b3cea3da to your computer and use it in GitHub Desktop.
Save natalia-chikina/1b347e8856045abe024a1082b3cea3da to your computer and use it in GitHub Desktop.
- name: Configure iptables for Master
user: root
hosts: "{{spark_master_group_name}}"
sudo: yes
vars_files:
- ../vars/network-vars.yml
- ../vars/spark-vars.yml
tasks:
- name: Add rule to firewall for all ports
iptables: chain=INPUT in_interface=eth1 source={{hostvars[item][ip_interface]['ipv4']['address']}} jump=ACCEPT
with_items: "{{ groups[spark_cluster ~ 'spark_master'] | union(groups['inventorycalc_' ~ spark_cluster ~ '_node']) | union(groups[spark_cluster ~ 'spark_master']) }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment