Created
May 4, 2016 10:49
-
-
Save rvdh/9e945bde1ff51a59c555c9dfe6585e4a to your computer and use it in GitHub Desktop.
This file contains 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
--- | |
- hosts: all | |
become: true | |
gather_facts: false | |
tasks: | |
- name: check which policy.xml exist | |
stat: | |
path: "{{ item }}/policy.xml" | |
with_items: | |
- /etc/ImageMagick | |
- /etc/ImageMagick-6 | |
- /etc/ImageMagick-7 | |
- /usr/local/etc/ImageMagick | |
- /usr/local/etc/ImageMagick-6 | |
- /usr/local/etc/ImageMagick-7 | |
register: policy_xml | |
- name: for every policy.xml that exists ensure lines are in the config | |
lineinfile: | |
dest: "{{ item.0.item }}/policy.xml" | |
insertbefore: "</policymap>" | |
line: "{{ item.1 }}" | |
with_nested: | |
- "{{ policy_xml.results }}" | |
- [' <policy domain="coder" rights="none" pattern="EPHEMERAL" />', | |
' <policy domain="coder" rights="none" pattern="URL" />', | |
' <policy domain="coder" rights="none" pattern="HTTPS" />', | |
' <policy domain="coder" rights="none" pattern="MVG" />', | |
' <policy domain="coder" rights="none" pattern="MSL" />', | |
] | |
when: item.0.stat.exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment