Class: Ansible::Ruby::Modules::User

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/system/user.rb

Overview

Manage user accounts and user attributes. For Windows targets, use the M(win_user) module instead.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, fix_inclusion, #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), add the user to the groups specified in C(groups).,If C(no), user will only be added to the groups specified in C(groups), removing them from all other groups.

Returns:

  • (:yes, :no, nil)

    If C(yes), add the user to the groups specified in C(groups).,If C(no), user will only be added to the groups specified in C(groups), removing them from all other groups.



44
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 44

attribute :append

#commentString?

Returns Optionally sets the description (aka I(GECOS)) of user account.

Returns:

  • (String, nil)

    Optionally sets the description (aka I(GECOS)) of user account.



21
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 21

attribute :comment

#create_home: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.,Changed from C(createhome) to C(create_home) in version 2.5.

Returns:

  • (:yes, :no, nil)

    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.,Changed from C(createhome) to C(create_home) in version 2.5.



65
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 65

attribute :create_home

#expiresInteger?

Returns An expiry time for the user in epoch, it will be ignored on platforms that do not support this. Currently supported on GNU/Linux, FreeBSD, and DragonFlyBSD.,Since version 2.6 you can remove the expiry time specify a negative value. Currently supported on GNU/Linux and FreeBSD.

Returns:

  • (Integer, nil)

    An expiry time for the user in epoch, it will be ignored on platforms that do not support this. Currently supported on GNU/Linux, FreeBSD, and DragonFlyBSD.,Since version 2.6 you can remove the expiry time specify a negative value. Currently supported on GNU/Linux and FreeBSD.



115
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 115

attribute :expires

#force:yes, ...

Returns This only affects C(state=absent), it forces removal of the user and associated directories on supported platforms. The behavior is the same as C(userdel –force), check the man page for C(userdel) on your system for details and support.

Returns:

  • (:yes, :no, nil)

    This only affects C(state=absent), it forces removal of the user and associated directories on supported platforms. The behavior is the same as C(userdel –force), check the man page for C(userdel) on your system for details and support.



77
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 77

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.

Returns:

  • (:yes, :no, nil)

    Whether to generate a SSH key for the user in question. This will B(not) overwrite an existing SSH key.



88
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 88

attribute :generate_ssh_key

#groupString?

Returns Optionally sets the user’s primary group (takes a group name).

Returns:

  • (String, nil)

    Optionally sets the user’s primary group (takes a group name).



36
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 36

attribute :group

#groupsArray<String>, ...

Returns List of groups user will be added to. When set to an empty string C(”), C(null), or C(~), the user is removed from all groups except the primary group. (C(~) means C(null) in YAML),Before version 2.3, the only input format allowed was a comma separated string. Now this parameter accepts a list as well as a comma separated string.

Returns:

  • (Array<String>, String, nil)

    List of groups user will be added to. When set to an empty string C(”), C(null), or C(~), the user is removed from all groups except the primary group. (C(~) means C(null) in YAML),Before version 2.3, the only input format allowed was a comma separated string. Now this parameter accepts a list as well as a comma separated string.



40
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 40

attribute :groups

#hiddenSymbol?

Returns macOS only, optionally hide the user from the login window and system preferences.,The default will be ‘True’ if the I(system) option is used.

Returns:

  • (Symbol, nil)

    macOS only, optionally hide the user from the login window and system preferences.,The default will be ‘True’ if the I(system) option is used.



25
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 25

attribute :hidden

#homeObject?

Returns Optionally set the user’s home directory.

Returns:

  • (Object, nil)

    Optionally set the user’s home directory.



52
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 52

attribute :home

#local:yes, ...

Returns Forces the use of “local” command alternatives on platforms that implement it. This is useful in environments that use centralized authentification when you want to manipulate the local users. I.E. it uses ‘luseradd` instead of `useradd`.,This requires that these commands exist on the targeted host, otherwise it will be a fatal error.

Returns:

  • (:yes, :no, nil)

    Forces the use of “local” command alternatives on platforms that implement it. This is useful in environments that use centralized authentification when you want to manipulate the local users. I.E. it uses ‘luseradd` instead of `useradd`.,This requires that these commands exist on the targeted host, otherwise it will be a fatal error.



123
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 123

attribute :local

#login_classObject?

Returns Optionally sets the user’s login class, a feature of most BSD OSs.

Returns:

  • (Object, nil)

    Optionally sets the user’s login class, a feature of most BSD OSs.



85
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 85

attribute :login_class

#move_home:yes, ...

Returns If set to C(yes) when used with C(home=), attempt to move the user’s old home directory to the specified directory if it isn’t there already and the old home exists.

Returns:

  • (:yes, :no, nil)

    If set to C(yes) when used with C(home=), attempt to move the user’s old home directory to the specified directory if it isn’t there already and the old home exists.



69
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 69

attribute :move_home

#nameString

Returns Name of the user to create, remove or modify.

Returns:

  • (String)

    Name of the user to create, remove or modify.



13
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 13

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.

Returns:

  • (:yes, :no, nil)

    Optionally when used with the -u option, this option allows to change the user ID to a non-unique value.



29
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 29

attribute :non_unique

#passwordObject?

Returns Optionally set the user’s password to this crypted value.,On macOS systems, this value has to be cleartext. Beware of security issues.,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.

Returns:



58
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 58

attribute :password

#password_lockSymbol?

Returns Lock the password (usermod -L, pw lock, usermod -C). BUT implementation differs on different platforms, this option does not always mean the user cannot login via other methods. This option does not disable the user, only lock the password. Do not change the password in the same task. Currently supported on Linux, FreeBSD, DragonFlyBSD, NetBSD.

Returns:

  • (Symbol, nil)

    Lock the password (usermod -L, pw lock, usermod -C). BUT implementation differs on different platforms, this option does not always mean the user cannot login via other methods. This option does not disable the user, only lock the password. Do not change the password in the same task. Currently supported on Linux, FreeBSD, DragonFlyBSD, NetBSD.



119
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 119

attribute :password_lock

#remove:yes, ...

Returns This only affects C(state=absent), it attempts to remove directories associated with the user. The behavior is the same as C(userdel –remove), check the man page for details and support.

Returns:

  • (:yes, :no, nil)

    This only affects C(state=absent), it attempts to remove directories associated with the user. The behavior is the same as C(userdel –remove), check the man page for details and support.



81
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 81

attribute :remove

#seuserObject?

Returns Optionally sets the seuser type (user_u) on selinux enabled systems.

Returns:

  • (Object, nil)

    Optionally sets the seuser type (user_u) on selinux enabled systems.



33
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 33

attribute :seuser

#shellString?

Returns Optionally set the user’s shell.,On macOS, before version 2.5, the default shell for non-system users was /usr/bin/false. Since 2.5, the default shell for non-system users on macOS is /bin/bash.,On other operating systems, the default shell is determined by the underlying tool being used. See Notes for details.

Returns:

  • (String, nil)

    Optionally set the user’s shell.,On macOS, before version 2.5, the default shell for non-system users was /usr/bin/false. Since 2.5, the default shell for non-system users on macOS is /bin/bash.,On other operating systems, the default shell is determined by the underlying tool being used. See Notes for details.



48
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 48

attribute :shell

#skeletonObject?

Returns Optionally set a home skeleton directory. Requires create_home option!.

Returns:

  • (Object, nil)

    Optionally set a home skeleton directory. Requires create_home option!



55
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 55

attribute :skeleton

#ssh_key_bitsString?

Returns Optionally specify number of bits in SSH key to create.

Returns:

  • (String, nil)

    Optionally specify number of bits in SSH key to create.



92
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 92

attribute :ssh_key_bits

#ssh_key_commentString?

Returns Optionally define the comment for the SSH key.

Returns:

  • (String, nil)

    Optionally define the comment for the SSH key.



104
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 104

attribute :ssh_key_comment

#ssh_key_fileString?

Returns Optionally specify the SSH key filename. If this is a relative filename then it will be relative to the user’s home directory.

Returns:

  • (String, nil)

    Optionally specify the SSH key filename. If this is a relative filename then it will be relative to the user’s home directory.



100
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 100

attribute :ssh_key_file

#ssh_key_passphraseObject?

Returns Set a passphrase for the SSH key. If no passphrase is provided, the SSH key will default to having no passphrase.

Returns:

  • (Object, nil)

    Set a passphrase for the SSH key. If no passphrase is provided, the SSH key will default to having no passphrase.



108
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 108

attribute :ssh_key_passphrase

#ssh_key_typeString?

Returns Optionally specify the type of SSH key to generate. Available SSH key types will depend on implementation present on target host.

Returns:

  • (String, nil)

    Optionally specify the type of SSH key to generate. Available SSH key types will depend on implementation present on target host.



96
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 96

attribute :ssh_key_type

#state:absent, ...

Returns Whether the account should exist or not, taking action if the state is different from what is stated.

Returns:

  • (:absent, :present, nil)

    Whether the account should exist or not, taking action if the state is different from what is stated.



61
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 61

attribute :state

#system:yes, ...

Returns When creating an account C(state=present), setting this to C(yes) makes the user a system account. This setting cannot be changed on existing users.

Returns:

  • (:yes, :no, nil)

    When creating an account C(state=present), setting this to C(yes) makes the user a system account. This setting cannot be changed on existing users.



73
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 73

attribute :system

#uidInteger?

Returns Optionally sets the I(UID) of the user.

Returns:

  • (Integer, nil)

    Optionally sets the I(UID) of the user.



17
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 17

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.

Returns:

  • (:always, :on_create, nil)

    C(always) will update passwords if they differ. C(on_create) will only set the password for newly created users.



111
# File 'lib/ansible/ruby/modules/generated/system/user.rb', line 111

attribute :update_password