blob: 07bb16ea75ffdaf56682fbfab4cd78dc5e6689b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
---
- name: Netmaster IPtables | Get iptables rules
command: iptables -L --wait
register: iptablesrules
check_mode: no
- name: Netmaster IPtables | Enable iptables at boot
service:
name: iptables
enabled: yes
state: started
- name: Netmaster IPtables | Open Netmaster with iptables
command: /sbin/iptables -I INPUT 1 -p tcp --dport {{ item }} -j ACCEPT -m comment --comment "contiv"
with_items:
- "{{ netmaster_port }}"
- "{{ contiv_rpc_port1 }}"
- "{{ contiv_rpc_port2 }}"
- "{{ contiv_rpc_port3 }}"
when: iptablesrules.stdout.find("contiv") == -1
notify: Save iptables rules
|