puppet命令语法 
 
 
[root@cn-iss-config-01 manifests (pvg01 %)]# puppet help
Usage: puppet [options] [options]
 
Available subcommands:
 
 agent              The puppet agent daemon
 apply              Apply Puppet manifests locally
 ca                 Local Puppet Certificate Authority management.
 catalog            Compile, save, view, and convert catalogs.
 cert               Manage certificates and requests
 certificate        Provide access to the CA for certificate management.
 certificate_request Manage certificate requests.
 certificate_revocation_list Manage the list of revoked certificates.
 config             Interact with Puppet's configuration options.
 describe           Display help about resource types
 device             Manage remote network devices
 doc                Generate Puppet documentation and references
 facts              Retrieve and store facts.
 file               Retrieve and store files in a filebucket
 filebucket         Store and retrieve files in a filebucket
 help               Display Puppet help.
 inspect            Send an inspection report
 instrumentation_data Manage instrumentation listener accumulated data.
 instrumentation_listener Manage instrumentation listeners.
 instrumentation_probe Manage instrumentation probes.
 key                Create, save, and remove certificate keys.
 kick               Remotely control puppet agent
 man                Display Puppet manual pages.
 master             The puppet master daemon
 module             Creates, installs and searches for modules on the Puppet Forge.
 node               View and manage node definitions.
 parser             Interact directly with the parser.
 plugin             Interact with the Puppet plugin system.
 queue              Queuing daemon for asynchronous storeconfigs
 report             Create, display, and submit reports.
 resource           The resource abstraction layer shell
 resource_type      View classes, defined resource types, and nodes from all manifests.
 secret_agent       Mimics puppet agent.
 status             View puppet server status.
 
See 'puppet help ' for help on a specific subcommand action.
See 'puppet help ' for help on a specific subcommand.
Puppet v3.0.0
[root@cn-iss-config-01 manifests (pvg01 %)]#
 
一、命令
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
# 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