accounts
: This class auto-creates user and group resources from hiera data.accounts::user::defaults
: Load some user defaults from hiera data.
accounts::user
: This resource manages the user, group, vim/, .ssh/, .bash_profile, .bashrc, homedir, .ssh/authorized_keys files, and directories.
accounts::home_dir
: This resource specifies how home directories are managed.accounts::key_management
: This resource specifies where ssh keys are managed.accounts::manage_keys
: This resource manages ssh keys for a user.
accounts_ssh_authorized_keys_line_parser
: Parse an ssh authorized_keys line string into an array using its expected pattern by using a combination of regex matching and extracting theaccounts_ssh_options_parser
: Parse an ssh authorized_keys option string into an array using its expected pattern which matches a crazy regex slightly modified from shell
Accounts::Group::Hash
: A hash of group resources, keyed by group name.Accounts::Group::Provider
: The specific backend to use for this group resource.Accounts::Group::Resource
: A hash of group attributes.Accounts::User::Expiry
: Account access will be denied after this date.Accounts::User::Hash
: A hash of user resources, keyed by user name.Accounts::User::Iterations
: Chained computation iterations for the PBKDF2 password hash.Accounts::User::Name
: Each user or group should have a unique alphanumeric name.Accounts::User::PasswordMaxAge
: Maximum days between password changes.Accounts::User::Resource
: A hash of user attributes.Accounts::User::Uid
: Each user on a system should have a unique numeric uid.
This class auto-creates user and group resources from hiera data.
The following parameters are available in the accounts
class:
Data type: Accounts::Group::Resource
Hash of default attributes for group resources managed by this class.
Default value: {}
Data type: Accounts::Group::Hash
Hash of group resources for this class to manage. The hash is keyed by group name.
Default value: {}
Data type: Accounts::User::Resource
Hash of default attributes for accounts::user resources managed by this class.
Default value: {}
Data type: Accounts::User::Hash
Hash of accounts::user resources for this class to manage. The hash is keyed by user name.
Default value: {}
Load some user defaults from hiera data.
The following parameters are available in the accounts::user::defaults
class:
Data type: Stdlib::AbsolutePath
The sprintf template used to determine a user's home directory.
Default value: '/home/%s'
Data type: Stdlib::AbsolutePath
The shell assigned to locked user accounts.
Default value: '/sbin/nologin'
Data type: Stdlib::AbsolutePath
The home directory of the root user.
Default value: '/root'
This resource manages the user, group, vim/, .ssh/, .bash_profile, .bashrc, homedir, .ssh/authorized_keys files, and directories.
accounts::user { 'bob':
uid => '4001',
gid => '4001',
group => 'staff',
shell => '/bin/bash',
password => '!!',
locked => false,
}
The following parameters are available in the accounts::user
defined type:
ensure
allowdupe
bash_profile_content
bash_profile_source
bashrc_content
bashrc_source
comment
create_group
expiry
forcelocal
forward_content
forward_source
gid
group
groups
home
home_mode
ignore_password_if_empty
iterations
locked
managehome
managevim
membership
name
password
password_max_age
purge_sshkeys
purge_user_home
salt
shell
sshkey_custom_path
sshkey_group
sshkey_owner
sshkey_mode
sshkeys
system
uid
Data type: Enum['absent','present']
Specifies whether the user, its primary group, homedir, and ssh keys should exist. Valid values are 'present' and 'absent'. Note that when a user is created, a group with the same name as the user is also created.
Default value: 'present'
Data type: Boolean
Whether to allow duplicate UIDs. By default false
Default value: false
Data type: Optional[String]
The content to place in the user's ~/.bash_profile file. Mutually exclusive to bash_profile_source.
Default value: undef
Data type: Optional[Stdlib::Filesource]
A source file containing the content to place in the user's ~/.bash_profile file. Mutually exclusive to bash_profile_content.
Default value: undef
Data type: Optional[String]
The content to place in the user's ~/.bashrc file. Mutually exclusive to bashrc_source.
Default value: undef
Data type: Optional[Stdlib::Filesource]
A source file containing the content to place in the user's ~/.bashrc file. Mutually exclusive to bashrc_content.
Default value: undef
Data type: String
A comment describing or regarding the user.
Default value: $name
Data type: Boolean
Specifies if you want to create a group with the user's name.
Default value: true
Data type: Optional[Accounts::User::Expiry]
Specifies the date the user account expires on. Valid values: YYYY-MM-DD date format, or 'absent' to remove expiry date.
Default value: undef
Data type: Optional[Boolean]
Specifies whether you want to manage a local user/group that is also managed by a network name service.
Default value: undef
Data type: Optional[String]
The content to place in the user's ~/.forward file. Mutually exclusive to forward_source.
Default value: undef
Data type: Optional[Stdlib::Filesource]
A source file containing the content to place in the user's ~/.forward file. Mutually exclusive to forward_content.
Default value: undef
Data type: Optional[Accounts::User::Uid]
Specifies the gid of the user's primary group. Must be specified numerically.
Default value: undef
Data type: Accounts::User::Name
Specifies the name of the user's primary group. By default, this uses a group named the same as user name
Default value: $name
Data type: Array[Accounts::User::Name]
Specifies the user's group memberships.
Default value: []
Data type: Optional[Stdlib::Unixpath]
Specifies the path to the user's home directory.
-
Linux, non-root user: '/home/$name'
-
Linux, root user: '/root'
-
Solaris, non-root user: '/export/home/$name'
-
Solaris, root user: '/'
Default value: undef
Data type: Optional[Stdlib::Filemode]
Manages the user's home directory permission mode. Valid values are in octal notation, specified as a string. Defaults to undef, which creates a home directory with 0700 permissions. It does not touch them if the directory already exists. Keeping it undef also allows a user to manage their own permissions. If home_mode is set, Puppet enforces the permissions on every run.
Default value: undef
Data type: Boolean
Specifies whether an empty password attribute should be ignored. If set to true, a password attribute that is defined but set to the empty string is ignored, allowing the password to be managed outside of this Puppet module. If set to false, it sets the password to an empty value.
Default value: false
Data type: Optional[Accounts::User::Iterations]
This is the number of iterations of a chained computation of the PBKDF2 password hash. This field is required for managing passwords on OS X >= 10.8.
Default value: undef
Data type: Boolean
Specifies whether the account should be locked and the user prevented from logging in. Set to true for users whose login privileges have been revoked.
Default value: false
Data type: Boolean
Specifies whether the user's home directory should be created when adding a user.
Default value: true
Data type: Boolean
Specifies whether or not the .vim folder should be created within the managed accounts home directory.
Default value: true
Data type: Enum['inclusive','minimum']
Establishes whether specified groups should be considered the complete list (inclusive) or the minimum list (minimum) of groups to which the user belongs. Valid values: 'inclusive', 'minimum'.
Default value: 'minimum'
Name of the user.
Data type: Variant[String, Sensitive[String]]
The user's password, in whatever encrypted format the local machine requires. Default: '!!', which prevents the user from logging in with a password.
Default value: '!!'
Data type: Optional[Accounts::User::PasswordMaxAge]
Maximum number of days a password may be used before it must be changed.
Allows any integer from -1
to 99999
. See the
user
resource.
Default value: undef
Data type: Boolean
Whether keys not included in sshkeys should be removed from the user. If purge_sshkeys is true and sshkeys is an empty array, all SSH keys will be removed from the user.
Default value: false
Data type: Boolean
Whether to force recurse remove user home directories when removing a user. Defaults to false.
Default value: false
Data type: Optional[String]
This is the 32-byte salt used to generate the PBKDF2 password used in OS X. This field is required for managing passwords on OS X >= 10.8.
Default value: undef
Data type: Stdlib::Unixpath
Manages the user shell.
Default value: '/bin/bash'
Data type: Optional[Stdlib::Unixpath]
Custom location for ssh public key file.
Default value: undef
Data type: Optional[Accounts::User::Name]
Specifies the group of the sshkey file
Default value: $group
Data type: Optional[Accounts::User::Name]
Specifies the owner of the sshkey file
Default value: $name
Data type: Variant[Integer[0],String]
Specifies the mode of the sshkey file .ssh/authorized_keys.
Default value: '0600'
Data type: Array[String[1]]
An array of SSH public keys associated with the user. These should be complete public key strings that include the type, content and name of the key, exactly as it would appear in its id_*.pub file, or with an optional options string preceding the other components, as it would appear as an entry in an authorized_keys file. Must be an array.
Examples:
-
ssh-rsa AAAAB3NzaC1y... [email protected]
-
from="myhost.example.com,192.168.1.1" ssh-rsa AAAAQ4ng... [email protected]
Note that for multiple keys, the name component (the last) must be unique.
Default value: []
Data type: Boolean
Specifies if you want to create a system account.
Default value: false
Data type: Optional[Accounts::User::Uid]
Specifies the user's uid number. Must be specified numerically.
Default value: undef
Type: Ruby 4.x API
Parse an ssh authorized_keys line string into an array using its expected pattern by using a combination of regex matching and extracting the substring before the match as ssh-options. This allows whitespaces inside the options and inside the comment and is consistent with the behavior of openssh. The returned options element can by an empty string.
accounts_ssh_authorized_keys_line_parser_string('options ssh-rsa AAAA... comment)
Parse an ssh authorized_keys line string into an array using its expected pattern by using a combination of regex matching and extracting the substring before the match as ssh-options. This allows whitespaces inside the options and inside the comment and is consistent with the behavior of openssh. The returned options element can by an empty string.
Returns: Array
of authroized_keys_line components:
['options','keytype','key','comment']
accounts_ssh_authorized_keys_line_parser_string('options ssh-rsa AAAA... comment)
Data type: String[1]
ssh authorized_keys line string
Type: Ruby 4.x API
Parse an ssh authorized_keys option string into an array using its expected pattern which matches a crazy regex slightly modified from shell words. The pattern should be a string.
accounts_ssh_option_parser_string()
Parse an ssh authorized_keys option string into an array using its expected pattern which matches a crazy regex slightly modified from shell words. The pattern should be a string.
Returns: Array
Separated components of the string
accounts_ssh_option_parser_string()
Data type: String
ssh authorized_keys option string
Group resoureces hash. Passed as the second parameter of the ensure_resources function.
Alias of Hash[Accounts::User::Name, Accounts::Group::Resource]
Group provider. You will seldom need to specify this -- Puppet will usually discover the appropriate provider for your platform.
Alias of Enum['aix', 'directoryservice', 'groupadd', 'ldap', 'pw', 'windows_adsi']
Group attributes hash. Passed as the third parameter of the ensure_resources function.
Alias of
Struct[{ Optional[ensure] => Enum['absent', 'present'],
Optional[allowdupe] => Boolean,
Optional[auth_membership] => Boolean,
Optional[forcelocal] => Boolean,
Optional[gid] => Accounts::User::Uid,
Optional[members] => Array[Accounts::User::Name],
Optional[name] => Accounts::User::Name,
Optional[provider] => Accounts::Group::Provider,
Optional[system] => Boolean,
}]
Account expiration date. Either 'absent' or a YYYY-MM-DD datestring.
Alias of Variant[Enum['absent'], Pattern[/\A(19|[2-9]\d)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])\z/]]
User resources hash. Passed as the second parameter of the ensure_resources function.
Alias of Hash[Accounts::User::Name, Accounts::User::Resource]
Password hash iterations. This parameter is used in OS X, and is required for managing passwords on OS X 10.8 and newer.
Alias of Variant[Integer[1,], Pattern[/\A[1-9]\d*\z/]]
Account (user or group) name. From useradd(8): It is usually recommended to only use usernames that begin with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes. They can end with a dollar sign. Usernames may only be up to 32 characters long.
Many installations also allow capitals or periods, for example to separate first and last names.
Alias of Pattern[/\A[a-zA-Z0-9_]([a-zA-Z.0-9_-]{0,30}[a-zA-Z0-9_$-])?\z/]
Max password age. On most systems, the default value of 99999 is about 274 years, which effectively disables password aging.
Alias of Integer[-1, 99999]
User attributes hash. Passed as the third parameter of the ensure_resources function.
Alias of
Struct[{ Optional[ensure] => Enum['absent','present'],
Optional[allowdupe] => Boolean,
Optional[bash_profile_content] => String,
Optional[bash_profile_source] => Stdlib::Filesource,
Optional[bashrc_content] => String,
Optional[bashrc_source] => Stdlib::Filesource,
Optional[comment] => String,
Optional[create_group] => Boolean,
Optional[expiry] => Accounts::User::Expiry,
Optional[forcelocal] => Boolean,
Optional[forward_content] => String,
Optional[forward_source] => Stdlib::Filesource,
Optional[gid] => Accounts::User::Uid,
Optional[group] => Accounts::User::Name,
Optional[groups] => Array[Accounts::User::Name],
Optional[name] => Accounts::User::Name,
Optional[home] => Stdlib::Unixpath,
Optional[home_mode] => Stdlib::Filemode,
Optional[ignore_password_if_empty] => Boolean,
Optional[iterations] => Accounts::User::Iterations,
Optional[locked] => Boolean,
Optional[managehome] => Boolean,
Optional[managevim] => Boolean,
Optional[membership] => Enum['inclusive','minimum'],
Optional[password] => String,
Optional[password_max_age] => Accounts::User::PasswordMaxAge,
Optional[purge_sshkeys] => Boolean,
Optional[purge_user_home] => Boolean,
Optional[salt] => String,
Optional[shell] => Stdlib::Unixpath,
Optional[sshkey_custom_path] => Stdlib::Unixpath,
Optional[sshkey_owner] => Accounts::User::Name,
Optional[sshkey_group] => Accounts::User::Name,
Optional[sshkeys] => Array[String],
Optional[system] => Boolean,
Optional[uid] => Accounts::User::Uid,
}]
Numeric user ID. On most Unix systems, the highest uid is 2^32 - 1, or 4294967295.
Alias of
Variant[Integer[0,4294967295], Pattern[/\A0\z/,
/\A[1-3]\d{0,9}\z/,
/\A[4-9]\d{0,8}\z/,
/\A4[0-1]\d{8}\z/,
/\A42[0-8]\d{7}\z/,
/\A429[0-3]\d{6}\z/,
/\A4294[0-8]\d{5}\z/,
/\A42949[0-5]\d{4}\z/,
/\A429496[0-6]\d{3}\z/,
/\A4294967[0-1]\d{2}\z/,
/\A42949672[0-8]\d\z/,
/\A429496729[0-5]\z/,
]]