Skip to content

Instantly share code, notes, and snippets.

@henkjan
Forked from rvdh/imagetragic.yml
Last active June 1, 2016 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henkjan/60ee47e2819069e0198d9435d16f0452 to your computer and use it in GitHub Desktop.
Save henkjan/60ee47e2819069e0198d9435d16f0452 to your computer and use it in GitHub Desktop.
---
- 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