Created
February 18, 2014 01:02
-
-
Save zdw/9062533 to your computer and use it in GitHub Desktop.
ansible example of dicts and with_items
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: allow http traffic through firewall | |
lineinfile: dest=/etc/sysconfig/iptables | |
regexp="^-A INPUT -p {{item.protocol}} -m {{item.protocol}} --dport {{item.port}} -j ACCEPT$" | |
line="-A INPUT -p {{item.protocol}} -m {{item.protocol}} --dport {{item.port}} -j ACCEPT" | |
insertafter="^-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT$" | |
with_items: | |
- { protocol: tcp, port: 80 } | |
notify: | |
- restart iptables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment