Version information
This version is compatible with:
- Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet 4.x
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'camptocamp-accounts', '1.11.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 => hiera_hash('accounts::ssh_keys', {}),
users => hiera_hash('accounts::users', {}),
usergroups => hiera_hash('accounts::usergroups', {}),
}
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
).
2019-07-30 - Release 1.11.1
- Allow augeasproviders_shellvar 4
2019-07-30 - Release 1.11.0
- Add system option to accounts::account (#60)
- Fix beaker version
- Do not use legacy puppet-lint-absolute_classname-check plugin
- Pass through managehome on absent (#62) (fix #61)
- strformat function: use loop instead of recursion (#64)
- Allow ssh_options for accounts being created through accounts::usergroups as well (#66)
- Merge group arrays instead of rightmost precedence (#65)
- Add expiry parameter (#55)
- Add additional prerequisite (#53)
- Allow augeasproviders_shellvar 3.x
- Fix puppet error if the account is not yet created (#41)
- Allow stdlib 5 & 6
- Fix tests on Puppet 6
2018-01-03 - Release 1.10.0
Remove absent keys when user resource not managed by module
2017-05-22 - Release 1.9.3
Really fix automated release system...
2017-05-22 - Release 1.9.2
Fix automated release system
2017-01-10 - Release 1.9.0
Remove Puppet 3 support Fix ParseError test
2016-06-20 - Release 1.8.1
Update test files
2016-02-18 - Release 1.8.0
Parameterize managehome (issue #21)
2015-11-12 - Release 1.7.0
Allow to set options to ssh_authorized_key
2015-10-19 - Release 1.6.0
Add ability to set a password hash for a user Add uid and gid params to accounts::account Don't create absent ssh_authorized_key resources if purge_ssh_keys is enabled
2015-08-21 - Release 1.5.1
Use docker for acceptance tests
2015-07-15 - Release 1.5.0
Add home parameter
2015-07-02 - Release 1.4.0
Add shell parameter
2015-06-26 - Release 1.3.5
Fix strict_variables activation with rspec-puppet 2.2
2015-05-28 - Release 1.3.4
Add beaker_spec_helper to Gemfile
2015-05-26 - Release 1.3.3
Use random application order in nodeset
2015-05-26 - Release 1.3.2
add utopic & vivid nodesets
2015-05-25 - Release 1.3.1
Don't allow failure on Puppet 4
2015-05-22 - Release 1.3.0
Fix User resource title when $user != $name purge_ssh_key is actually supported in 3.6.0 Add support for user comment
2015-05-13 - Release 1.2.2
Add puppet-lint-file_source_rights-check gem
2015-05-12 - Release 1.2.1
Don't pin beaker
2015-05-07 - Release 1.2.0
Add support for changing users default membership
2015-04-27 - Release 1.1.11
Add nodeset ubuntu-12.04-x86_64-openstack
2015-04-03 - Release 1.1.10
Confine rspec pinning to ruby 1.8
2015-03-24 - Release 1.1.9
Various spec improvements
2015-02-24 - Release 1.1.8
purge_ssh_keys was alwaus set to false... don't use purge_ssh_keys when puppet version < 3.6 Update unit tests Update meta files
2015-01-05 - Release 1.1.7
Use CHANGELOG.md Simplify bundler cache in Travis CI Fix license name in metadata.json
2014-12-16 - Release 1.1.3
Fix exec resource name Fix unit tests
2014-11-17 - Release 1.1.2
Lint metadata.json
2014-11-04 - Release 1.1.1
Fix when no target Fix when purging with no target Inverse hashes order in merge so that we can override params in hiera Set user to root when using a target Allow string formating for target Forward authorized_keys_target and purge_ssh_keys when using usergroups
2014-10-28 - Release 1.1.0
Add purge-ssh-key support Remove puppet < 3.6 support
2014-10-28 - Release 1.0.2
Fix an issue when using ssh_authorized_key_title and usergroup Fix an issue when adding a user without ssh key defined
2014-10-20 - Release 1.0.1
Really setup automatic Forge release
2014-10-20 - Release 1.0.0
Setup automatic Forge releases
Dependencies
- puppetlabs/stdlib (>=3.2.0 <7.0.0)
- herculesteam/augeasproviders_shellvar (>=2.2.1 < 5.0.0)