Skip to content

Instantly share code, notes, and snippets.

@ju5t
Created March 5, 2016 09:44
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 ju5t/62aca37fbb92b2908966 to your computer and use it in GitHub Desktop.
Save ju5t/62aca37fbb92b2908966 to your computer and use it in GitHub Desktop.
---
#
# Patch exim.conf version 2.1.1 to include keep_environment=PWD
#
- hosts: directadmin
serial: 10
max_fail_percentage: 20
tasks:
- name: "patch: check exim.conf version"
shell: "grep -c 'SpamBlocker.exim.conf.2.1.*-release' /etc/exim.conf"
register: exim_conf_2_1_1
changed_when: False
failed_when: False
- name: "patch: /etc/exim.conf"
lineinfile:
dest=/etc/exim.conf
state=present
insertbefore="^(#)?\.include_if_exists\ \/etc\/exim\.clamav\.load\.conf"
line="keep_environment=PWD"
register: exim_patch
when: exim_conf_2_1_1.rc == 0
- name: "patch: restart exim"
service:
name=exim
state=restarted
when: exim_patch.changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment