I'm creating a formula/state file that adds an iptables
rule:
ipt_allow:
iptables.append:
- table: filter
- chain: INPUT
- jump: ACCEPT
- match: state
- connstate: 'NEW,ESTABLISHED'
- dport: 6666
- proto: tcp
- source: 'ip1, ip2, ip3, ...'
I don't want to hard code the IP addresses in source
. ip1
, ip2
, and ip3
are the IP addresses of minions that match the grain role:role1
. That way, if I ever add more minions with the grain role1
down the road, they'll get added to the iptables rule once I rerun this state file. How do I do this?