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.
 
 
 
 

56 lines
1.5 KiB

#!pydsl
state("elasticsearch_exporter_private ipv4 chain").iptables.chain_present(
"elasticsearch_exporter_private",
family="ipv4",
)
state("elasticsearch_exporter_private ipv6 chain").iptables.chain_present(
"elasticsearch_exporter_private",
family="ipv6",
)
addresses_v4 = __salt__.minion_net.public_addresses("app:metrics", target_type="grain", addr_type="ipv4")
for address in addresses_v4:
# Salt private
state("elasticsearch_exporter ipv4 " + address).iptables.append(
table="filter",
family="ipv4",
chain="elasticsearch_exporter_private",
source=address,
protocol="tcp",
match="tcp",
dport=9114,
)
addresses_v6 = __salt__.minion_net.public_addresses("app:metrics", target_type="grain", addr_type="ipv6")
for address in addresses_v6:
state("elasticsearch_exporter ipv6 " + address).iptables.append(
table="filter",
family="ipv6",
chain="elasticsearch_exporter_private",
source=address,
protocol="tcp",
match="tcp",
dport=9114,
)
state("elasticsearch_exporter_private ipv4 input chain").iptables.append(
table="filter",
family="ipv4",
chain="INPUT",
match="comment",
comment="elasticsearch_exporter_private",
jump="elasticsearch_exporter_private",
)
state("elasticsearch_exporter_private ipv6 input chain").iptables.append(
table="filter",
family="ipv6",
chain="INPUT",
match="comment",
comment="elasticsearch_exporter_private",
jump="elasticsearch_exporter_private",
)