Created
May 21, 2018 14:49
-
-
Save kamigerami/81d0bc34f8b0cdc3361a76a60af87bb8 to your computer and use it in GitHub Desktop.
idempotent DNS rules ansible lineinfile module
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: Create persistent DNS rules for acepting port 53 | |
lineinfile: | |
path: /etc/sysconfig/iptables | |
state: "{{ item.1 }}" | |
insertbefore: "^-A INPUT (1 - p {{ item.0 }} -- dport 53 -j ACCEPT)?" | |
line: "-A INPUT 1 -p {{ item.0 }} --dport 53 -j ACCEPT" | |
with_nested: | |
- ['TCP', 'UDP'] | |
- ['absent', 'present'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment