LoginSignup
1
1

More than 5 years have passed since last update.

puppet入門7 ファイルに変更があった時にサービスをrestartさせる

Last updated at Posted at 2013-12-04

notifysource、そして該当するserviceの指定を行えばよい。
ファイルの内容だけでなく、owner,group,modeのどれかが変わってもサービスがrestartします。

node 'puppetmaster.safe' {
  file { ['/etc/sysconfig/snmpd.options']:
      owner   => 'root',
      group   => 'root',
      mode    => '755',
      require => Package['net-snmp'],
      notify  => Service['snmpd'],
      source => 'puppet:///rhel5/etc/sysconfig/snmpd.options',
  }

  service { 'snmpd':
    enable  => true,
    ensure  => running,
    require => Package['net-snmp'],
  }
}
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1