Class: Ansible::Ruby::Modules::User
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::User
- Defined in:
- lib/ansible/ruby/modules/generated/core/system/user.rb
Overview
Manage user accounts and user attributes.
Instance Method Summary collapse
-
#append ⇒ :yes, ...
If C(yes), will only add groups, not set them to just the list in I(groups).
-
#comment ⇒ String?
Optionally sets the description (aka I(GECOS)) of user account.
-
#createhome ⇒ :yes, ...
Unless set to C(no), a home directory will be made for the user when the account is created or if the home directory does not exist.
-
#expires ⇒ String?
An expiry time for the user in epoch, it will be ignored on platforms that do not support this.
-
#force ⇒ :yes, ...
When used with C(state=absent), behavior is as with C(userdel –force).
-
#generate_ssh_key ⇒ :yes, ...
Whether to generate a SSH key for the user in question.
-
#group ⇒ String?
Optionally sets the user’s primary group (takes a group name).
-
#groups ⇒ Array<String>, ...
Puts the user in this comma-delimited list of groups.
-
#home ⇒ Object?
Optionally set the user’s home directory.
-
#login_class ⇒ Object?
Optionally sets the user’s login class for FreeBSD, OpenBSD and NetBSD systems.
-
#move_home ⇒ :yes, ...
If set to C(yes) when used with C(home=), attempt to move the user’s home directory to the specified directory if it isn’t there already.
-
#name ⇒ String
Name of the user to create, remove or modify.
-
#non_unique ⇒ :yes, ...
Optionally when used with the -u option, this option allows to change the user ID to a non-unique value.
-
#password ⇒ Object?
Optionally set the user’s password to this crypted value.
-
#remove ⇒ :yes, ...
When used with C(state=absent), behavior is as with C(userdel –remove).
-
#seuser ⇒ Object?
Optionally sets the seuser type (user_u) on selinux enabled systems.
-
#shell ⇒ String?
Optionally set the user’s shell.
-
#skeleton ⇒ Object?
Optionally set a home skeleton directory.
-
#ssh_key_bits ⇒ Integer?
Optionally specify number of bits in SSH key to create.
-
#ssh_key_comment ⇒ String?
Optionally define the comment for the SSH key.
-
#ssh_key_file ⇒ String?
Optionally specify the SSH key filename.
-
#ssh_key_passphrase ⇒ Object?
Set a passphrase for the SSH key.
-
#ssh_key_type ⇒ String?
Optionally specify the type of SSH key to generate.
-
#state ⇒ :present, ...
Whether the account should exist or not, taking action if the state is different from what is stated.
-
#system ⇒ :yes, ...
When creating an account, setting this to C(yes) makes the user a system account.
-
#uid ⇒ String?
Optionally sets the I(UID) of the user.
-
#update_password ⇒ :always, ...
C(always) will update passwords if they differ.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#append ⇒ :yes, ...
Returns If C(yes), will only add groups, not set them to just the list in I(groups).
38 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 38 attribute :append |
#comment ⇒ String?
Returns Optionally sets the description (aka I(GECOS)) of user account.
15 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 15 attribute :comment |
#createhome ⇒ :yes, ...
Returns Unless set to C(no), a home directory will be made for the user when the account is created or if the home directory does not exist.
59 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 59 attribute :createhome |
#expires ⇒ String?
Returns An expiry time for the user in epoch, it will be ignored on platforms that do not support this. Currently supported on Linux and FreeBSD.
109 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 109 attribute :expires |
#force ⇒ :yes, ...
Returns When used with C(state=absent), behavior is as with C(userdel –force).
71 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 71 attribute :force |
#generate_ssh_key ⇒ :yes, ...
Returns Whether to generate a SSH key for the user in question. This will B(not) overwrite an existing SSH key.
82 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 82 attribute :generate_ssh_key |
#group ⇒ String?
Returns Optionally sets the user’s primary group (takes a group name).
30 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 30 attribute :group |
#groups ⇒ Array<String>, ...
Returns Puts the user in this comma-delimited list of groups. When set to the empty string (‘groups=’), the user is removed from all groups except the primary group.
34 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 34 attribute :groups |
#home ⇒ Object?
Returns Optionally set the user’s home directory.
46 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 46 attribute :home |
#login_class ⇒ Object?
Returns Optionally sets the user’s login class for FreeBSD, OpenBSD and NetBSD systems.
75 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 75 attribute :login_class |
#move_home ⇒ :yes, ...
Returns If set to C(yes) when used with C(home=), attempt to move the user’s home directory to the specified directory if it isn’t there already.
63 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 63 attribute :move_home |
#name ⇒ String
Returns Name of the user to create, remove or modify.
11 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 11 attribute :name |
#non_unique ⇒ :yes, ...
Returns Optionally when used with the -u option, this option allows to change the user ID to a non-unique value.
23 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 23 attribute :non_unique |
#password ⇒ Object?
Returns Optionally set the user’s password to this crypted value. See the user example in the github examples directory for what this looks like in a playbook. See U(docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module) for details on various ways to generate these password values. Note on Darwin system, this value has to be cleartext. Beware of security issues.
52 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 52 attribute :password |
#remove ⇒ :yes, ...
Returns When used with C(state=absent), behavior is as with C(userdel –remove).
78 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 78 attribute :remove |
#seuser ⇒ Object?
Returns Optionally sets the seuser type (user_u) on selinux enabled systems.
27 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 27 attribute :seuser |
#shell ⇒ String?
Returns Optionally set the user’s shell.
42 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 42 attribute :shell |
#skeleton ⇒ Object?
Returns Optionally set a home skeleton directory. Requires createhome option!.
49 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 49 attribute :skeleton |
#ssh_key_bits ⇒ Integer?
Returns Optionally specify number of bits in SSH key to create.
86 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 86 attribute :ssh_key_bits |
#ssh_key_comment ⇒ String?
Returns Optionally define the comment for the SSH key.
98 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 98 attribute :ssh_key_comment |
#ssh_key_file ⇒ String?
Returns Optionally specify the SSH key filename. If this is a relative filename then it will be relative to the user’s home directory.
94 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 94 attribute :ssh_key_file |
#ssh_key_passphrase ⇒ Object?
Returns Set a passphrase for the SSH key. If no passphrase is provided, the SSH key will default to having no passphrase.
102 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 102 attribute :ssh_key_passphrase |
#ssh_key_type ⇒ String?
Returns Optionally specify the type of SSH key to generate. Available SSH key types will depend on implementation present on target host.
90 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 90 attribute :ssh_key_type |
#state ⇒ :present, ...
Returns Whether the account should exist or not, taking action if the state is different from what is stated.
55 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 55 attribute :state |
#system ⇒ :yes, ...
Returns When creating an account, setting this to C(yes) makes the user a system account. This setting cannot be changed on existing users.
67 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 67 attribute :system |
#uid ⇒ String?
Returns Optionally sets the I(UID) of the user.
19 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 19 attribute :uid |
#update_password ⇒ :always, ...
Returns C(always) will update passwords if they differ. C(on_create) will only set the password for newly created users.
105 |
# File 'lib/ansible/ruby/modules/generated/core/system/user.rb', line 105 attribute :update_password |