Hi Esco: On Tuesday, October 20, 2015 at 3:31:11 PM UTC-5, esco real wrote: could you explain what exactly the problem is here? Maybe posting some examples with actual/ and expected results?
Nothing insurmountable. Just trying to formulate in my own mind what works the best. I was/am able to work around the issues I'll detail, but I'd rather have had a uniform approach up front. First Issue: pre-existing relayhost on a handful of servers. I used regex: to catch the empty hosts Unintended result, hosts with existing relayhost had two set. Second issue: Too loose/tight regex (either or both). Correcting the first issue either led to duplication's or just updated the duplicates to uniform values. It looks like backrefs is a partial fix for this, but after a little reflection I realized that in this case (and many other cases like it) my best approach is to create two rules, one that deletes the line first, and then a role to add it. In particular this catches multiple lines in file. It's also easier to get the regex correct (i.e, "delete all other lines that might set the var") -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/251451e7-2c36-4576-938e-acf548938978%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
