Hi David,

Many thanks for the information, but still I am having some issues with 
puppet class when I am trying to use double quotes.

This is working good
"setm *[label() =~ glob('ifcfg-eth*')] NM_CONTROLLED no",

But, this isn't. I tried few combinations of single and double quotes, but 
none of them are working :(
"setm *[label() =~ glob('ifcfg-eth*')] NM_CONTROLLED \'"no"\'",

Regards,
Vikas


On Thursday, 14 August 2014 03:05:11 UTC+10, David Lutterkort wrote:
>
> 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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/98964bf3-b072-4930-b436-ef8453e948e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to