I have a template for ifcfg-* files where I not only fill in DNS entries but 
also all the other network configuration
stuff. I put this into a role and all variables are in host_vars/*.yaml files. 
Every time I wish to change the
configuration I change the host_vars file and reapply the role (which creates a 
new ifcfg file from the template with
the new settings).



Am 28.08.2017 um 21:06 schrieb John Harmon:
> Hmmm.... I am trying it this way... and am really close.  I just don't know 
> how to properly reference variables in a
> regexp statement within ansible:
> 
> |
> -name:TEST
>   replace:
>     path:"{{ net_path }}{{ item }}"
>     regexp:"^DNS(?!.*(?:10.10.10.1[12])).*"
>   with_items:"{{ ifcfg_list.stdout_lines }}"
> |
> 
> I want to replace 10.10.10.1[12] with the variables dns1 and dns2
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9308bf8f-96d0-463d-b869-6598c1e514c5%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/9308bf8f-96d0-463d-b869-6598c1e514c5%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/3ee865ff-efc4-e3e4-6f76-2291074e70e0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to