Search code examples
puppetaugeas

puppet augeas resource only support avalialbe lenses


I am automating rhnplugin config file in puppet, below is my manifests

augeas { 'config' :
    lens => 'Simplevars.lns',
    incl => '/etc/yum/pluginconf.d/rhnplugin.conf',
   changes => 'set /etc/yum/pluginconf.d/rhnplugin.conf/test " " '
 }

getting below error

Warning: Augeas[config](provider=augeas): Loading failed for one or more files, see debug for /augeas//error outputeven

I tried with "simplelines lenses" not getting any o/p

I used "simplelines and simplevars" since could not find lenses for rhnplugin.

I treid in augtool and it worked

augtool> set /files/etc/yum/pluginconf.d/rhnplugin.conf/test
augtool> save
Saved 1 file(s)
augtool> set /files/etc/yum/pluginconf.d/rhnplugin.conf/test/enabled 1
augtool> save
Saved 1 file(s)
augtool> print /files/etc/yum/pluginconf.d/rhnplugin.conf/test
/files/etc/yum/pluginconf.d/rhnplugin.conf/test
/files/etc/yum/pluginconf.d/rhnplugin.conf/test/enabled = "1"

My doubt is can't we convert int to augeas resource if the lenses are not available.


Solution

  • rhnplugin.conf is not in a simplevars (i.e. key=value) format. It is an inifile. My recommendation would be to use puppet labs' inifile module to modify it.