updatedb.conf with augeas

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

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 -0500 )edit