On May 3rd, details were published about a vulnerability in ImageMagick, allowing remote code execution if you process user submitted images. Exploits for this vulnerability are being used in the wild.
The following ansible playbook may be used to apply the policy file mitigation discussed on that website. If the server(s) you wish to protect has a policy.xml file in a different location, be sure to modify the with_items list of the first task.
To execute the playbook, save it in a file called imagetragick.yml and execute it using ansible-playbook: