Augeas

From Wiki
Jump to: navigation, search

http://projects.puppetlabs.com/projects/1/wiki/Puppet_Augeas

Set a mail alias with augtool:

set /files/etc/mail/aliases/*[name = 'www']/value "webmaster"
save

Remove setting from a file:

rm /files/etc/sysconfig/network-scripts/ifcfg-eth0/IPV6ADDR_SECONDARIES
save

To do this in puppet the manifest should look this.

 include augeas

 augeas { "wwwwalias":
  context => "/files/etc/mail/aliases",
  changes => "set /files/etc/mail/aliases/*[name = 'www']/value 'webmaster'",
}
include augeas

augeas {'/etc/sysconfig/network-scripts/ifcfg-eth0':
                context => "/files/etc/sysconfig/network-scripts/ifcfg-eth0",
                changes => "rm IPV6ADDR_SECONDARIES",
       }