ftnk.jp -> ~fumi -> ChangeLog -> 2009-09 -> 2009-09-09

前の日 / 次の日 / 最新 / 2009-09

2009-09 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

2009-09-09 Wed

[別の年の同じ日: 2002 2004 2005 2007 2008 2010

今日の del.icio.us (2009-09-09) はてぶ

- ログ関連の設定 — Let's Postgres
- チケット駆動開発 - Live a meaningful Life

Puppet で特定のファイルが更新されたら任意のコマンドを実行する [Puppet][server] はてぶ

/etc/aliases や /etc/postfix/{canonical,transport} あたりが
更新されたら newaliases や postmap を実行したい.

と思ったら,そのままな例が
http://reductivelabs.com/trac/puppet/wiki/TypeReference#exec
にあった.

# Pull down the main aliases file
file { "/etc/aliases":
    source => "puppet://server/module/aliases"
}

# Rebuild the database, but only when the file changes
exec { newaliases:
    path => ["/usr/bin", "/usr/sbin"],
    subscribe => File["/etc/aliases"],
    refreshonly => true
}

コマンドに引数をとらせたい時は,
上の「newaliases」の行に引数まで書けばいい.