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.