Pages

Monday, August 5, 2013

puppet augeas

Augeas controls configuration files composed of key/value pairs. It might seem weird and hard to use at the beginning, but it's sure easier and friendlier then grep and sed.
Controlling the hostname with augeas and restarting rsyslog service:

class hostname ($hostname){
  augeas{ 'sysconf-hostname':
    context     => '/files/etc/sysconfig/network',
    changes     => ["set HOSTNAME $hostname"],
    notify      => Service['rsyslog'],
  }


augtool is a very nice tool which help you figure out which files and options are under augeas control.

No comments:

Post a Comment