puppet命令詳解+配置文件

puppet命令詳解+配置文件
這些命令保存着有用!
一、命令
puppet 用於執行用戶所寫獨立的mainfests文件
用法:
puppet [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
[--detailed-exitcodes] [-l|--logdest ]
# puppet -l /tmp/manifest.log manifest.pp

puppetd 運行在被管理主機上的客戶端程序
用法:
puppetd [-D|--daemonize|--no-daemonize] [-d|--debug] [--disable] [--enable]
[-h|--help] [--fqdn ] [-l|--logdest syslog||console]
[-o|--onetime] [--serve ] [-t|--test] [--noop]
[-V|--version] [-v|--verbose] [-w|--waitforcert ]
# puppetd ?server puppet.domain.com

puppetmasterd 運行在管理機上的服務器程序
用法:
puppetmasterd [-D|--daemonize|--no-daemonize] [-d|--debug] [-h|--help]
[-l|--logdest |console|syslog] [--nobucket] [--nonodes]
[-v|--verbose] [-V|--version]
# puppetmasterd

puppetca puppet認證程序
用法:
puppetca [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
[-g|--generate] [-l|--list] [-s|--sign] [-r|--revoke]
[-p|--print] [-c|--clean] [--verify] [host]
# puppetca -l
culain.madstop.com
# puppetca -s culain.madstop.com

puppetrun 用於連接客戶端,強制運行在本地配置文件下
用法:
puppetrun [-a|--all] [-c|--class ] [-d|--debug] [-f|--foreground]
[-h|--help] [--host ] [--no-fqdn] [--ignoreschedules]
[-t|--tag ] [--test] [-p|--ping]
# puppetrun -p 10 ?host host1 ?host host2 -t remotefile -t webserver

filebucket 客戶端用於發送文件到puppet file bucket的工具
用法:
filebucket [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
[-l|--local] [-r|--remote]
[-s|--server ] [-b|--bucket ] …
# filebucket -b /tmp/filebucket /my/file

ralsh 轉換配置信息到puppet配置代碼
用法:
ralsh [-h|--help] [-d|--debug] [-v|--verbose] [-e|--edit] [-H|--host ]
[-p|--param
] [-t|--types] type
# ralsh user luke
user { ‘luke’:
home => ‘/home/luke’,
uid => ‘100′,
ensure => ‘present’,
comment => ‘Luke Kanies,,,’,
gid => ‘1000′,
shell => ‘/bin/bash’,
groups => ['sysadmin','audio','video','puppet']
}

puppetdoc 打印puppet參考文檔
用法:
puppetdoc [-a|--all] [-h|--help] [-o|--outputdir ]
[-m|--mode ]
[-r|--reference <[type]|configuration|..>] [manifest-file]
# puppetdoc -r type > /tmp/type_reference.rst
# puppetdoc ?outputdir /tmp/rdoc ?mode rdoc /path/to/manifests
# puppetdoc /etc/puppet/manifests/site.pp

生成服務器與客戶端的配置文件
# puppetmasterd ?genconfig > puppet.conf
# puppetd ?genconfig > puppet.conf

二、配置文件puppet.conf
默認情況下,配置文件位於/etc/puppet目錄下,文件名爲puppet.conf

配置文件命名空間
main 通用配置選項
puppetd 客戶端配置選項
puppetmasterd 服務端配置選項

main命名空間選項
confdir 配置文件目錄,默認在/etc/puppet
vardir 動態數據目錄,默認在/var/puppet
logdir 日誌目錄,默認在$vardir/log
rundir puppet PID目錄,默認在$vardir/run
statedir state目錄,默認在$vardir/state
statefile state文件,默認在$statedir/state.yaml
ssldir SSL證書目錄,默認在$confdir/ssl
trace 發生錯誤時顯示跟蹤信息,默認false
filetimeout 檢測配置文件狀態改變的時間週期,單位秒,默認15秒
syslogfacility 指定syslog功能爲user級,默認爲daemon級

puppetmasterd命名空間選項
user 後臺進程執行的用戶
group 後臺進程執行的組
mainfestdir mainfests文件存儲目錄,默認爲$confdir/mainfests
mainfest mainfest站點文件的名字,默認爲site.pp
bindaddress 後臺進程綁定的網卡地址接口
masterport 後臺進程執行的端口,默認爲8140

puppet命名空間選項
server puppet puppet服務器,默認爲puppet
runinterval seconds puppet應用配置的時間間隔,默認1800秒(0.5小時)
puppetdlockfie file puppet lock文件位置,默認$statedir/puppetdlock
puppetport port 後臺進程執行的端口,默認8139
發佈了4 篇原創文章 · 獲贊 9 · 訪問量 23萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章