Hi David,

I am getting following error:

Error: /Stage[main]/Aug_mod::Configuration_files/Augeas[host_file]: Could 
not evaluate: undefined method `set' for #<Augeas:0x7f5eb79ab100>

while the same is working fine with augtool on command line.

Please help.

Regards,
Shrawan

On Tuesday, 28 June 2016 12:01:06 UTC+5:30, Shrawan Bhagwat wrote:
>
> Hi David,
>
> Thanks for your response.
>
> I have done that as guided in this: 
> http://www.unixarena.com/2016/02/puppet-augeas-edit-system-configuration-files.html
>
> Can you please help me with it's working?
>
> As of now i have created class for augeas similar to normal modules of 
> puppet in init.pp and declared it in site.pp, but it's throwing an error in 
> it's declaration.  
>
> So please tell me where i m doing wrong.
>
> for changing hosts file:
> init.pp :
> class  aug_mod{
>
>         class{'configuration_files':}
>         include configuration_files
>
>
> #        configuration_files { }
> }
>
> configuration_files.pp:
> class aug_mod::configuration_files{
>
>         augeas{'host_file':
>                 #lens => 'hosts.aug',
>                 context => '/chroot/httpd/files/etc/hosts',
>                 changes => [
>           'set /chroot/httpd/files/etc/hosts/01/ipaddr 192.168.0.1',
>           'set /chroot/httpd/files/etc/hosts/01/canonical 
> pigiron.example.com',
>           'set /chroot/httpd/files/etc/hosts/01/alias[1] pigiron',
>           'set /chroot/httpd/files/etc/hosts/01/alias[2] piggy',
>     ],
>     #onlyif => "match *[.='${title}']";
> }
>
> }
>
>
>
> On Monday, 27 June 2016 20:24:13 UTC+5:30, David Lutterkort wrote:
>>
>> On Friday, June 24, 2016 at 3:29:25 PM UTC+2, Shrawan Bhagwat wrote:
>>>
>>> Hi All,
>>>
>>> I have installed Augeas setup from yum repository using command yum 
>>> install ruby-augeas.x86_64.
>>>
>>> I have got all packages of Augeas but not able to find command Augtool.
>>>
>>> Please help!
>>>
>>
>> If you are using the  puppet-agent package from http://yum.puppet.com/, 
>> augtool (and augparse) are installed into /opt/puppetlabs/puppet/bin
>>
>> If you are not using the puppet-agent package, run 'yum install augeas'. 
>> That works for Fedora; for RHEL/CentOS, augtool is not in the base distro, 
>> and you have to first enable EPEL before running that yum command
>>
>> David
>>
>

-- 
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/40e72669-17d2-43ca-a473-8e2918d2a001%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to