updatedb.conf with augeas

asked 2017-05-18 09:34:14 -0600

dcs02d gravatar image

New devops programmer here... I'm re-factoring puppet code and trying to keep content (hiera) separate from code to keep the sysadmins to editing hiera files.

I've successfully used augeas with hash arrays in puppet for most conf files but I'm stuck on /etc/updatedb.conf

This works with augtool:

[root@machine]$ augtool set /files/etc/updatedb.conf/PRUNEPATHS some_folder
Saved 1 file(s)
[root@puppetlab etc]$ grep PRUNEPATHS /etc/updatedb.conf
PRUNEPATHS = some_folder

But in puppet I get an error:

[root@puppetlab etc]$ puppet apply --verbose --modulepath=/etc/puppetlabs/code/environments/production/modules/ -e "augeas { \"updatedb.conf\": changes => [ 'set /files/etc/updatedb.conf/PRUNEPATHS some_folder' ] }" 
Info: Loading facts
Info: Loading facts
Info: Loading facts
Notice: Compiled catalog for puppetlab.localdomain in environment production in 0.16 seconds
Info: Applying configuration version '1495117608'
Error: /Stage[main]/Main/Augeas[updatedb.conf]: Could not evaluate: Saving failed, see debug
Notice: Applied catalog in 1.49 seconds

I'm at a roadblock here and it seems augeas errors via puppet do not show up in /augeas//error

Any pointers would be appreciated. If I were not OCD I'd just do it another way and move on but I'm OCD and I need it to all be the same ;)

edit retag flag offensive close merge delete


Does it show extra logging for augeas if you run puppet apply with --debug?

smarlow gravatar imagesmarlow ( 2017-05-18 13:55:14 -0600 )edit

I meet the same problem, puppet version 4.10.12 augueas is 1.4.0, the debug info is: /augeas/files/etc/updatedb.conf/error/message = Malformed child node 'PRUNEPATHS' I tried serveral times and give up, use file_line to replace it.

newptone gravatar imagenewptone ( 2018-06-20 18:34:55 -0600 )edit