23. クラスでリソースをまとめる 「sudo」クラスを定義 class sudo{ package { ‘sudo’: ensure => latest, alias => sudo } file { ‘/etc/sudoers’: source => 'puppet://server/module/sudoers', mode => 440, owner => $default_owner, group => $default_group, alias => sudoers } } node ‘mail.hoge.com’ { include sudo } package リソース file リソース クラスをノードに適用
24. クラスを継承する base クラスを定義 class base { file { "/my/file": content => template("base.erb") } } class sub inherits base { # override the content File["/my/file"] { content => template("other.erb") } } base クラスを継承した sub クラスを定義 base クラスの /my/file リソースの属性を上書き
32. マニフェスト適用(クライアント/サーバ版) サーバ起動 # /usr/sbin/puppetmasterd --verbose br /> --no-daemonize --nonodes info: Starting server for Puppet version 0.24.8 info: Listening on port 8140 notice: Starting Puppet server version 0.24.8
33. マニフェストを適用(クライアント/サーバ版) クライアントで適用 # /usr/sbin/puppetd --server puppet.hoge.com br />--no-daemonize --verbose --onetime info: No classes to store info: Caching catalog at /var/puppet/state/localconfig.yaml notice: Starting catalog run notice: //File[/etc/passwd]/mode: mode changed '777' to '644' notice: Finished catalog run in 0.03 seconds