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