user { 'dave': ensure => present, uid => '507', gid => 'admin', shell => '/bin/ksh', home => '/home/dave', managehome => true, }
This syntax is called a resource declaration
puppet describe
: The puppet describe
subcommand can list info about the currently installed resource types on a given machine. puppet resource
: Puppet includes a command called puppet resource
, which can interactively inspect and modify resources on a single system. Usage:# puppet resource <TYPE> [<NAME>] [ATTRIBUTE=VALUE ...]
.pp
: Puppet programs are called “manifests,” and they use the .pp
file extension.puppet apply <.pp file >
before
, require
, notify
, and subscribe
metaparameters.→
and ~>
chaining arrows.ordering
setting in puppet.conf
determines the order in which unrelated resources are applied.if
, elseif
, else
, case
,default
include <class name>
来起作用。modulepath
, which is a configurable settingmanifests
,files
,templates
等等, 详看 a page of info about module layout 以及 module cheat sheet.files/
下)的引用格式: puppet:///modules/模块名/文件名(可包括files下的子路径)
例如:
puppet:///modules/ntp/config_files/linux/ntp.conf.el
引用ntp
模块下的files/config_files/linux/ntp.conf.el
文件.
/etc/puppetlabs/puppet/puppet.conf
$ sudo puppet module install puppetlabs-mysql//forge 里模块名有用户名前缀
List all installed modules:
$ sudo puppet module list
.erb
extension. and be stored in the templates/
directory of any module. There can be any number of subdirectories inside templates/
.template
: file {'/etc/foo.conf': ensure => file, require => Package['foo'], content => template('foo/foo.conf.erb'), }
template
参数格式为<MODULE NAME>/<FILENAME INSIDE TEMPLATES DIRECTORY>
.
inline_template