Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
- Puppet >= 6.0.0 < 9.0.0
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'camptocamp-accounts', '2.1.1'
Learn more about managing modules with a PuppetfileDocumentation
Accounts
Usage
First, you have to declare your ssh_keys
, users
and usergroups
hashes:
class { 'accounts':
ssh_keys => lookup('accounts::ssh_keys', Hash, 'hash', {}),
users => lookup('accounts::users', Hash, 'hash', {}),
usergroups => lookup('accounts::usergroups', 'Hash, 'hash', {}),
}
Example hiera YAML file:
---
accounts::ssh_keys:
foo:
type: ssh-rsa
public: FOO-S-RSA-PUBLIC-KEY
bar:
type: ssh-rsa
public: BAR-S-RSA-PUBLIC-KEY
accounts::users:
foo:
uid: 1000
comment: Foo
bar:
uid: 1001
comment: Bar
baz:
# Remove user baz from every node (unless overridden)
ensure: absent
qux:
uid: 1003
comment: Qux
accounts::usergroups:
foo:
- foo
- bar
bar:
- baz
- qux
Then you can create accounts on your node with the accounts::account
defined type.
accounts::account { 'foo': }
Creates a foo
user if it exists in $::accounts::users
and at allow its public key if it exists in $::accounts::ssh_keys
.
accounts::account { 'bar':
authorized_keys => ['@foo', 'baz'],
}
Creates a bar
user if it exists in $::accounts::users
and at allow its public key, everyone's in thefoo
usergroup's public key and baz
's one if it exists in $::accounts::ssh_keys
.
accounts::account { '@foo': }
Create a user for every user in foo
usergroup and allow its public key.
Module Parameters
groups
Hash of groups to create (passed to create_resources
). Defaults to {}
.
groups_membership
Default value for the users' membership
parameter. Refer to the Puppet documentation for more information.
ssh_keys
Hash of SSH public keys that can be assigned to users (see Usage above).
users
Hash of users (see Usage above).
usergroups
Hash of user groups (see Usage above).
accounts
Hash of accounts to create (see Usage above).
forcelocal
Set the resource "user" parameter so that the users are not created/supressed in external user directories (i.e. LDAP).
start_uid
Sets the lowest uid for non system users. This is a system setting and also affects users created outside of this module.
start_gid
Sets the lowest gid for non system groups. This is a system setting and also affects groups or users created outside of this module.
purge_ssh_keys
Default value for users' purge_ssh_keys
parameter. When true
all SSH keys in a users authorized_keys
file not managed by Puppet will be deleted. Defaults to false
.
shell
Default value for users' shell
parameter. Default is the system default (usually /bin/sh
).
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
2.0.1 - 2023-10-11
Other
- ⬆️ Deprecate has_key #70 (JGodin-C2C)
2.0.0 - 2023-10-11
Other
- ⬆️ Deprecate has_key #70 (JGodin-C2C)
- Fix pull #66 again after pull #56 was merged #68 (erik-frontify)
1.11.1 - 2019-07-30
1.11.0 - 2019-07-30
Other
- Allow ssh_options for accounts being created through accounts::usergr… #66 (erik-frontify)
- Merge group arrays instead of rightmost precedence #65 (kobybr)
- Use loop instead of recursion #64 (seidler2547)
- Fixes #61 - Pass through managehome on absent #62 (edestecd)
- Update to add the system option to account.pp #60 (mooresm1)
- Correcting issue #15 #56 (jschaeff)
- added expiry parameter #55 (cjeanneret)
- Add additional prerequisite #53 (trevharmon)
- Fix puppet error if the account is not yet created #41 (Zophar78)
1.10.0 - 2018-01-03
1.9.3 - 2017-05-26
1.9.2 - 2017-05-22
Other
1.9.1 - 2017-03-31
Other
1.9.0 - 2017-01-10
Other
1.8.1 - 2016-06-20
1.8.0 - 2016-02-18
Other
1.7.0 - 2015-11-12
Other
1.6.0 - 2015-10-19
Other
- Don't create absent ssh_authorized_key resources if purge_ssh_keys is… #22 (mcanevet)
- Add ability to set a password hash for a user. Undef = !. #18 (johnzimm)
- Add uid and gid params to accounts::account #14 (mcanevet)
1.5.1 - 2015-08-21
1.5.0 - 2015-07-15
1.4.0 - 2015-07-02
Other
1.3.5 - 2015-06-26
1.3.4 - 2015-05-28
1.3.3 - 2015-05-26
1.3.2 - 2015-05-26
1.3.1 - 2015-05-25
1.3.0 - 2015-05-22
Other
- Add support for user comment #13 (mcanevet)
- Fix User resource title when $user != $name #12 (mcanevet)
1.2.2 - 2015-05-13
1.2.1 - 2015-05-12
1.2.0 - 2015-05-07
Other
1.1.11 - 2015-04-27
Other
- making sure the file is owned by user and not root. +the file permissions are 600 and not 444 #8 (pankajagarwal)
1.1.10 - 2015-04-03
1.1.9 - 2015-03-24
1.1.8 - 2015-02-24
Other
1.1.7 - 2015-01-05
1.1.6 - 2014-12-18
1.1.4 - 2014-12-18
1.1.3 - 2014-12-16
Other
1.1.2 - 2014-11-17
1.1.1 - 2014-11-04
1.1.0 - 2014-10-30
1.0.2 - 2014-10-28
1.0.1 - 2014-10-20
0.1.0 - 2014-09-05
Dependencies
- puppetlabs/stdlib (>=9.4.0 <10.0.0)
- herculesteam/augeasproviders_shellvar (>=2.2.1 < 5.0.0)