今天來介紹Puppet的具體實用功能,其實我的理解就是怎麼偷懶,呵呵。
1.填充檔案內容:
(server):
修改server端設定檔:
# vi /etc/puppet/manifests/site.pp
-----------------
node default{
file { "/tmp/test":
content=> "this is a test file";
}
}
-----------------
重啟puppetmaster,更新設定檔資訊。
# service puppetmaster restart
(client):
重啟puppet(可不用重啟)
# service puppet restart
同步檔案:
# puppetd --server server.example.com --test
------------------
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for client.example.com
info: Caching certificate_revocation_list for ca
info: Caching catalog for client.example.com
info: Applying configuration version '1369124449'
notice: /Stage[main]//Node[default]/File[/tmp/test]/ensure: defined content as '{md5}100b144907af2a4786003758a0a6a563'
info: Creating state file /var/lib/puppet/state/state.yaml
notice: Finished catalog run in 0.02 seconds
------------------
查看/tmp/test檔案及檔案內容
# cat /tmp/test
-----------
this is a test file
-----------