Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
- Puppet >= 5.0.0 < 7.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'bibigon812-users', '1.2.2'
Learn more about managing modules with a PuppetfileDocumentation
Users
This module manages users and their SSH authorized keys.
Usage
Allow hiera find this module.
lookup('classes', Array[String[1]], 'unique', []).include
classes:
- users
users::virtual:
user1:
comment: Test user1
tag: tag1
ssh_authorized_keys:
-
key: AAAAB3Nza[...]qXfdaQ==
type: ssh-rsa
comment: my@key
users::realized:
- user1
Reference
Table of Contents
Classes
users
: This class manages users and their SSH authorized keys.
Defined types
users::user
: Manages user and his SSH authorized keys.
Classes
users
It uses virtual and realized resources Users::User. All users parameters should be defined for all nodes in the hash users::virtual. Required users should be listed in the array users::realized for a node.
Examples
users::virtual:
user1:
comment: Test user1
tag: tag1
ssh_authorized_keys:
-
key: AAAAB3Nza[...]qXfdaQ==
type: ssh-rsa
users::realized:
- user1
Parameters
The following parameters are available in the users
class.
virtual
Data type: Hash
All users parameters.
realized
Data type: Array[String[1]]
List of users or tags to be realized.
Defined types
users::user
This defined type manages user and his SSH authorized keys. It's a proxy for the User and Ssh_authorized_key resources.
Examples
auth::user { 'vpupkin':
comment => 'Vasya Pupkin',
groups => ['sudo'],
ssh_authorized_keys => [
{
'key' => 'AAAAB3Nza[...]qXfdaQ==',
'type' => 'ssh-rsa',
'comment' => 'my@key',
},
],
}
Parameters
The following parameters are available in the users::user
defined type.
ensure
Data type: Enum['absent', 'present']
The basic state that the object should be in. Valid values are present, absent.
Default value: 'present'
managehome
Data type: Boolean
Whether to manage the home directory when Puppet creates or removes the user. This creates the home directory if Puppet also creates the user account, and deletes the home directory if Puppet also removes the user account.
Default value: true
comment
Data type: Optional[String[1]]
A description of the user. Generally the user’s full name.
Default value: undef
gid
Data type: Optional[Variant[ Integer[0], String[1] ]]
The user’s primary group. Can be specified numerically or by name.
Default value: undef
groups
Data type: Array[String[1]]
The groups to which the user belongs. The primary group should not be listed, and groups should be identified by name rather than by GID. Multiple groups should be specified as an array.
Default value: []
membership
Data type: Enum['inclusive', 'minimum']
If minimum is specified, Puppet will ensure that the user is a member of all specified groups, but will not remove any other groups that the user is a part of. If inclusive is specified, Puppet will ensure that the user is a member of only specified groups. Valid values are inclusive, minimum.
Default value: 'minimum'
ssh_authorized_keys
Data type: Array[Struct[{ 'type' => String[1], 'key' => String[1], 'comment' => Optional[String[1]], }]]
Contains an array of structures with the type, key and comment.
Default value: []
Changelog
All notable changes to this project will be documented in this file.
[1.2.2] - 2019-08-09
Added
- compatibility with Puppet 5.x.x
[1.2.1] - 2019-08-09
Added
- dependencies puppetlabs-sshkeys_core
- REFERENCE.md
Updated
- pdk
- puppet minimal versions
1.2.0 - 2018-09-27
Added
- default lookup options
1.1.0 - 2018-09-21
Changed
- a title of a ssh_authorized_key resource
Fixed
- compare links in the changelog file
Updated
- documentation
1.0.0 - 2018-09-21
Added
- a comment of a ssh authorized key
Changed
- pdk version to 1.7.0
Fixed
- comments
0.2.1 - 2018-06-21
Added
- resource
File['~/.ssh']
requiresFile['~/']
0.2.0 - 2018-06-21
Changed
- Users::User manages home dir by default.
0.1.1 - 2018-06-21
Fixed
- package bilding job
[0.1.0] - 2018-06-21
Added
- the class users has the parameters virtual and realized.
- the defined type users::user.
- CHANGELOG uses the keepchangelog.com format.
- README now contains necessary information.
Dependencies
- puppetlabs-stdlib (>= 5.0.0 < 7.0.0)
- puppetlabs-sshkeys_core (>= 1.0.0)