-
-
Save henkjan/60ee47e2819069e0198d9435d16f0452 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="path" rights="none" pattern="|*" />', | |
] | |
when: item.0.stat.exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment