Core Types Cheat Sheet
•
latest
•
{any version string}
•
absent
•
purged (Potentially dangerous. Ensures absent, then
zaps configuration files and dependencies, including
file
THE TRIFECTA
those that other packages depend on. Provider-
dependent.)
Manages local files.
Package/file/service: Learn it, live it, love it. If you can
●
— The name of the package, as known to your
name
only do this, you can still do a lot.
ATTRIBUTES
packaging system; defaults to title.
●
— Whether the file should exist, and what it
ensure
●
— Where to obtain the package, if your
source
should be.
system’s packaging tools don’t use a repository.
package { 'openssh-server':
•
present
ensure => installed,
●
See also:
adminfile, allowcdrom, category,
•
absent
}
configfiles, description, flavor, instance,
•
file
platform, provider, responsefile, root,
•
directory
file { '/etc/ssh/sshd_config':
status, type, vendor.
source
=> 'puppet:///modules/sshd/
•
link
sshd_config',
●
— The fully qualified path to the file; defaults
service
path
owner
=> 'root',
to title.
group
=> 'root',
Manages services running on the node. Like with
●
— Where to download the file. A puppet:///
mode
=> '640',
source
packages, some platforms have better tools than others,
URL to a file on the master, or a path to a local file on
notify
=> Service['sshd'], # sshd
so read up. To restart a service whenever a file changes,
will restart whenever you
the agent.
subscribe to the file or have the file notify the service.
edit this file.
●
— A string with the file’s desired contents.
content
require => Package['openssh-server'],
(subscribe => File[
'
sshd _ config
'
] or notify
Most useful when paired with templates, but you can
}
=> Service[
sshd
])
'
'
also use the output of the file function.
ATTRIBUTES
●
— The symlink target. (When ensure => link.)
service { 'sshd':
target
●
— The desired status of the service.
ensure => running,
ensure
●
— Whether to recursively manage the
recurse
enable => true,
•
running (or true)
directory. (When ensure => directory.)
hasstatus => true,
•
stopped (or false)
•
true or false
hasrestart => true,
●
— Whether the service should start on boot.
enable
●
— Whether to keep unmanaged files out of the
}
purge
Doesn’t work everywhere.
directory. (When recurse => true.)
•
true or false
•
true or false
●
— The name of the service to run; defaults
name
●
— By name or UID.
owner
to title.
●
— By name or GID.
group
●
— Manually
status, start, stop, and restart
●
— Must be specified exactly. Does the right thing
Package[openssh-server]
mode
specified commands for working around bad init
for directories.
scripts.
●
See also:
backup, checksum, force, ignore,
●
— Whether to use the init script’s restart
hasrestart
links, provider, recurselimit, replace,
command instead of stop+start. Defaults to false.
selrange, selrole, seltype, seluser,
•
true or false
sourceselect, type.
File[/etc/ssh/sshd_config]
●
— Whether to use the init script’s status
hasstatus
package
command instead of grepping the process table.
Defaults to false.
Manages software packages. Some platforms have better
•
true or false
package tools than others, so you’ll have to do some
●
— A regular expression to use when
pattern
research on yours; check the type reference for more info.
Service[sshd]
grepping the process table. Defaults to the name of
ATTRIBUTES
the service.
●
— The state for this package.
●
See also:
ensure
binary, control, manifest, path,
•
present
provider.