You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ansible-role-nginx/mongodb/roles/common/templates/iptables.j2

27 lines
835 B

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
{% if 'mongoc_servers' in group_names %}
-A INPUT -p tcp --dport 7777 -j ACCEPT
{% endif %}
{% if 'mongos_servers' in group_names %}
-A INPUT -p tcp --dport 8888 -j ACCEPT
{% endif %}
{% if 'mongo_servers' in group_names %}
{% for host in groups['mongo_servers'] %}
-A INPUT -p tcp --dport {{ mongod_ports[host] }} -j ACCEPT
{% endfor %}
{% endif %}
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT