Core Types Cheat Sheet Page 2

ADVERTISEMENT

HELLO WORLD
— A file created by this command; if the file
ATTRIBUTES
creates
exists, the command won’t run.
notify
(defaults to title)
name
— If true, the exec will only run if a
refreshonly
— The user ID. Must be specified numerically;
uid
Sends an arbitrary message to the agent run-time log.
resource it subscribes to (or a resource which notifies
chosen automatically if omitted.
it) has changed.
— Whether the user should exist.
ensure
true or false
present
notify { "This message is getting logged
— A command or array of commands; if any
onlyif
absent
on the agent node.": }
have a non-zero return value, the command won’t run.
role
— The opposite of onlyif.
notify { "Mac warning":
unless
— The user’s primary group. Can be specified
gid
message => $operatingsystem ? {
— An array of environment
numerically or by name.
environment
'Darwin' => "This seems to be a
variables to set (e.g.
[
'
MYVAR=somevalue
'
,
— An array of secondary groups to which the
groups
Mac.",
).
OTHERVAR=othervalue
]
'
'
user belongs. (Don’t include the group specified as the
default => "And I’m a PC.",
See also:
GID.)
},
cwd, group, logoutput, returns,
}
timeout, tries, try _ sleep, user.
— The user’s home directory.
home
— Whether to manage the home
managehome
cron
ATTRIBUTES
directory when managing the user; if you don’t set this
to true, you’ll need to create the user’s home directory
Defaults to title.
message —
Manages cron jobs. Largely self-explanatory.
manually.
See also:
withpath
true or false
cron { logrotate:
— The user’s login shell.
shell
command => "/usr/sbin/logrotate",
See also:
GRAB BAG
allowdupe, auths, comment, expiry,
user => root,
hour => 2,
key _ membership, keys, membership,
exec
minute => 0
password, password _ max _ age, password _
}
min _ age, profile _ membership, profiles,
Executes an arbitrary command on the agent node. When
project, provider, role _ membership, roles.
using execs, make sure the command can be safely run
ATTRIBUTES
multiple times or specify that it should only run under
group
— The command to execute.
certain conditions.
command
— Whether the job should exist.
ATTRIBUTES
ensure
Manages groups.
present
— The command to run; defaults to title. If
command
ATTRIBUTES
absent
this isn’t a fully-qualified path, use the path attribute.
(defaults to title)
name
hour, minute, month, monthday, and weekday
— A search path for executables; colon-
path
— The group ID; must be specified numerically,
— The timing of the cron job.
gid
separated list or an array. This is most useful as a
and will be chosen automatically if omitted.
See also:
resource default, e.g.:
environment, name, provider,
— Whether the group should exist.
ensure
special, target, user.
present
absent
Exec {
user
path => [
See also:
allowdupe, auth _ membership,
'/usr/local/bin',
Manages user accounts; mostly used for system users.
members, provider.
'/opt/local/bin',
'/usr/bin',
'/usr/sbin',
user { "dave":
'/bin',
EVERYTHING ELSE
ensure
=> present,
'/sbin'],
uid
=> '507',
logoutput => true,
gid
=> 'admin',
You are ready. Go check the types reference at
}
shell
=> '/bin/zsh',
home
=> '/home/dave',
exec {'pwd':}
managehome => true,
exec {'whoami':}
}

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2