add mongodb-firewall role for iptables rules
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
aa5c854732
commit
08e02096c8
|
@ -0,0 +1,3 @@
|
|||
# Description
|
||||
|
||||
This role simply open the TCP port in `iptables` based on value of `mongodb_net_port`.
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
mongodb_net_port: 27017
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- name: Save iptables rules
|
||||
shell: iptables-save > /etc/iptables/rules.v4
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Enable MongoDB port
|
||||
iptables:
|
||||
comment: 'MongoDB'
|
||||
jump: ACCEPT
|
||||
source: '0.0.0.0/0'
|
||||
protocol: 'tcp'
|
||||
destination_port: '{{ mongodb_net_port }}'
|
||||
notify:
|
||||
- Save iptables rules
|
Loading…
Reference in New Issue