puppet+rsyslog をやってみた

puppet使用ノードの /var/spool/cron/root

 */3 * * * * /usr/sbin/puppetd 
  --server centos-nvidia.example.or.jp --test

/etc/puppet/puppetd.conf の中に追記
[main] のどこかに

syslogfacility = local0


/etc/rsyslog.conf に追記

local0.info @@ubuntu-intel.example.or.jp


受けた側のrsyslog.conf

$template precise,"%syslogpriority-text%,%syslogfacility-text%,
  %timegenerated%,%HOSTNAME%,%syslogtag%,%msg%\n"
 *.*;auth,authpriv.none		-/var/log/syslog;precise

rsyslogの出力

info,local0,Apr 19 00:51:04,centos-virt1,puppetd[4378]:,
   Caching catalog at /var/lib/puppet/localconfig.yaml
notice,local0,Apr 19 00:51:04,centos-virt1,puppetd[4378]:,
   Starting catalog run
notice,local0,Apr 19 00:51:05,centos-virt1,puppetd[4378]:,
   (//Node[base]/apache/Service[httpd]/ensure) 
  ensure changed 'stopped' to 'running'
notice,local0,Apr 19 00:51:06,centos-virt1,puppetd[4378]:,
   Finished catalog run in 1.65 seconds

3行目であらかじめ停止しておいたhttpdが ensure=> running の効果で起動されている。



ハマりポイント
1. rsyslogでテンプレートを指定する場合、ファイルの行き先の次の記号はコロンではなく、セミコロン orz