On Tuesday, 28 November 2017 15.36.34 CET coach rhca wrote:
>
> thanks Kai, actually trying to edit a parameter in the network interface
> files I am using something like
> lineinfile: "dest=/etc/sysconfig/network-scripts/*ifcfg-{{
> ansible_default_ipv4.interface }*} regexp='^{{ item.regexp }}' line='{{
> item.line }}'"
>
>
> but this only gives me the default network card but i want to edit the
> changes in all the available network interfaces like ifcfg-en0117 or
> ifcfg-en037 whatever is present in the host except the lo interface..could
> you please suggest as to how we can do on multiple interface...thank you .
I would use the find module to find ifcfg-* in /etc/sysconfig/network-scripts/
and exclude ifcfg-lo.
Register the output in a variable and loop over the entries in the varaible
with with_items on lineinfile.
--
Kai Stian Olstad
--
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/2308705.zYZqbabTxQ%40x1.
For more options, visit https://groups.google.com/d/optout.