Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Puppet Accounts module
class accounts (
$virtual_accounts = {},
$defaults = {},
) {
$realize = hiera_array('accounts')
group { 'sudo-dev':
ensure => present,
gid => 514,
}
create_resources('@accounts::virtual', $virtual_accounts, $defaults)
realize (Accounts::Virtual[$realize])
}
define accounts::virtual (
$uid = undef,
$comment = undef,
$password = undef,
) {
user { $title:
ensure => 'present',
uid => $uid,
gid => $title,
shell => '/bin/bash',
home => "/home/${title}",
comment => $comment,
groups => ['sudo-dev'],
password => $password,
managehome => true,
}
group { $title:
gid => $uid,
}
}
accounts:
- user_one
- user_two
accounts::defaults: #unknown
password: '$6$5COqysSv$3x5pUIOg/xxr0KmYKtsdBio.Y7b7CveWVSaZ3/jVrDgtmHrHkwZkHIh5ckyY3AmCR0Fz.zM4o9X/MMkFhsWYf0'
accounts::virtual_accounts:
'user_one':
uid: 6246
comment: 'User One'
password: 'paste in a (partial) hash from /etc/shadow'
'user_two':
uid: 6247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.