Hi Vikas,
to set multiple nodes, you need to use the 'setm' command; 'set' will only
change a single node. Also, the path expressions in Augeas are more like
XPath, and therefore don't have globbing built in. In augtool, you'd do
what you want with this command:
setm /files/etc/sysconfig/network-scripts/*[label() =~ glob('ifcfg-*')]
NM_CONTROLLED no
The corresponding Augeas resource would be something like
augeas { "network-tweaks-RedHat":
context => "/files/etc/sysconfig/network-scripts",
changes => ["setm *[label() =~ glob('ifcfg-*')] NM_CONTROLLED no"],
}
David
On Monday, August 11, 2014 10:28:26 PM UTC-7, Vikas Kumar wrote:
>
> Dear All,
>
> I am trying to use augeas to change the value of NM_CONTROLLED to "no" on
> all my RHEL 6.X machines. However, the number of ethernet cards differ on
> each server, thus I want to use expression or wild cards.
>
> if $::operatingsystemmajrelease == '6' {
> augeas { "network-tweaks-RedHat":
> context => "/files/etc/sysconfig/network-scripts/ifcfg-eth[0-9]",
> changes => [
> 'set
> /files/etc/sysconfig/network-scripts/ifcfg-eth[0-9]/NM_CONTROLLED \'"no"\''
> ,
> ],
> }
> }
>
> I wrote the above code but it does't do the job. Please suggest.
>
> Regards,
> Vikas
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/9a33997e-119e-4c6f-9e90-e7f66123bb35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.