|
|
[root@mgt puppet]# cat modules/development/user/manifests/init.pp
class user {
define account($ensure = present, $uid, $gid,
$groups = [], $comment, $shell = "/bin/bash", $password) {
$username = $name
# realize the group
Group <| gid == $gid |>
# Create the user with their groups as specified
user { $username:
ensure => $ensure,
uid => $uid,
gid => $gid,
groups => $groups,
comment => $comment,
home => "/home/$username",
shell => $shell,
password => $password,
allowdupe => false,
managehome => true
}
file { "/home/$username/.ssh":
# and so on
}
}
@account { "admin":
ensure => present,
uid => "500",
gid => "admin",
comment => "Administrator",
# single quotes to avoid interpolation
password => '$1$password'
}
@account { "logger":
# etc
}
@group { "admin": ensure => present, gid => "500" }
@group { "logger": ensure => present, gid => "501" }
}
[root@mgt puppet]# cat modules/development/ntp/manifests/init.pp
class ntp {
package { "ntp": ensure => installed }
class timesync {
include user
Account <| title == "admin" |>
cron { "timesync":
command => "/usr/local/bin/timesync.sh",
user => "admin",
minute => "10",
require => Account["admin"]
}
}
}
err: Could not retrieve catalog: Could not find resource type account at /etc/puppet/modules/development/ntp/manifests/init.pp:12 on node web332
|