From d1672fe4fbdad20e51c74232675587d064c017f9 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 25 Jan 2018 20:17:58 +0100 Subject: [PATCH] library/roles/iptables/templates/iptables-rules.v4.j2: Do not fail if ganglia_unicast_mode is not defined. --- iptables/templates/iptables-rules.v4.j2 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/iptables/templates/iptables-rules.v4.j2 b/iptables/templates/iptables-rules.v4.j2 index b55e8851..65d6e76b 100644 --- a/iptables/templates/iptables-rules.v4.j2 +++ b/iptables/templates/iptables-rules.v4.j2 @@ -186,27 +186,28 @@ -A INPUT -m pkttype --pkt-type multicast -d {{ orientdb_hazelcast_multicast_group }} -j ACCEPT -A INPUT -m state --state NEW -p tcp -m tcp --dport {{ orientdb_hazelcast_multicast_port }} -j ACCEPT {% endif %} -{% if ganglia_enabled is defined %} -{% if ganglia_enabled %} -{% if ganglia_gmond_cluster_port is defined %} # Ganglia -{% if not ganglia_unicast_mode %} +{% if ganglia_enabled is defined and ganglia_enabled %} +{% if ganglia_gmond_cluster_port is defined %} +{% if ganglia_unicast_mode is defined %} +{% if ganglia_unicast_mode %} +{% for net in ganglia_unicast_networks %} +-A INPUT -p udp -m udp -s {{ net }} --dport {{ ganglia_gmond_cluster_port }} -j ACCEPT +{% endfor %} +{% else %} {% if ganglia_gmond_use_jmxtrans is not defined or not ganglia_gmond_use_jmxtrans %} -A INPUT -m pkttype --pkt-type multicast -d {{ ganglia_gmond_mcast_addr }} -j ACCEPT {% else %} -A INPUT -m pkttype --pkt-type multicast -j ACCEPT -A INPUT -p udp -m udp -d {{ ganglia_gmond_mcast_addr }} --dport {{ ganglia_gmond_cluster_port }} -j ACCEPT {% endif %} -{% else %} -{% for net in ganglia_unicast_networks %} --A INPUT -p udp -m udp -s {{ net }} --dport {{ ganglia_gmond_cluster_port }} -j ACCEPT -{% endfor %} +{% endif %} {% endif %} -A INPUT -m state --state NEW -s {{ ganglia_gmetad_host }} -p tcp -m tcp --dport {{ ganglia_gmond_cluster_port }} -j ACCEPT -A INPUT -s {{ ganglia_gmetad_host }} -p udp -m udp --dport {{ ganglia_gmond_cluster_port }} -j ACCEPT {% endif %} {% endif %} -{% endif %} +# Postfix {% if postfix_relay_server is defined %} {% if postfix_relay_server %} #