Ask Your Question

How to ensure that config file exists before running augeas against it

asked 2013-08-22 08:47:30 -0500

ljkimmel gravatar image

I noticed that augeas automatically creates a config file even when it does not exist. Since puppet does not enforce order it is quite possible that a config file could get created when a package does not exist. If ever that package gets installed the config file will probably get installed as '.rpmnew' and the config file created by augeas may only have a small subset of configurations in it. How can we ensure that augeas does not create a config file but only edits an existing one?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-23 02:01:59 -0500

GregLarkin gravatar image

You can create a dependency on your augeas resource that requires the package to be installed first. Something like this will work:

Package['pkgname'] -> Augeas['update pkgname config file']
edit flag offensive delete link more


You could also make your augeas definition require the package: `augeas {"some-config": require => Package['pkgname']}`

extraordinaire gravatar imageextraordinaire ( 2013-08-23 11:38:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-08-22 08:47:30 -0500

Seen: 400 times

Last updated: Aug 23 '13