[colug-432] Automatically Edit Configuration File: Ansible Patch Module Works Without Drama

Jon Miller jonebird at gmail.com
Thu Nov 19 14:46:11 EST 2015


jep200404 at columbus.rr.com writes:

> On Thu, 19 Nov 2015 11:20:10 -0500, jep200404 at columbus.rr.com wrote:
>
>> The first time I run the Ansible playbook, it works as desired
>> The next time I run the Ansible playbook, it changes something it should not.
>> Those multiline regexes are hard,
>> so on to trying Jim Wildman's suggestion on the Centos 7 vm.

Yeah, I figured even if one of those modules supported re.MULTILINE it would
end up being gnarly. 

> Before that, tried the patch module. 
> It works correctly and did so with little effort,
> likely because of the context it has.

I've taken the patch approach myself in the past, pre Ansible days, and it'll
work nicely for a while until the entire default httpd.conf file changes
significantly but perhaps that's a future worry.

> Still need to try Jim's suggestion.

Certainly those drop-ins are nice. I've had a recent conversation about other
config items that we wanted to change here that we couldn't accomplish with
an additional .conf file. (Related to altering default 'CustomLog' directive)

-- 
Jon Miller


More information about the colug-432 mailing list