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

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

Overview

Manage user accounts and user attributes.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

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).

Returns:

  • (:yes, :no, nil)

    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

#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.



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.

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.



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

attribute :createhome

#expiresString?

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.

Returns:

  • (String, nil)

    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).

Returns:

  • (:yes, :no, nil)

    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.

Returns:

  • (:yes, :no, nil)

    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

#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).



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

attribute :group

#groupsArray<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.

Returns:

  • (Array<String>, String, nil)

    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

#homeObject?

Returns Optionally set the user’s home directory.

Returns:

  • (Object, nil)

    Optionally set the user’s home directory.



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

attribute :home

#login_classObject?

Returns Optionally sets the user’s login class for FreeBSD, OpenBSD and NetBSD systems.

Returns:

  • (Object, nil)

    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.

Returns:

  • (:yes, :no, nil)

    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

#nameString

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

Returns:

  • (String)

    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.

Returns:

  • (:yes, :no, nil)

    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

#passwordObject?

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.

Returns:



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).

Returns:

  • (:yes, :no, nil)

    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

#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.



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

attribute :seuser

#shellString?

Returns Optionally set the user’s shell.

Returns:

  • (String, nil)

    Optionally set the user’s shell.



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

attribute :shell

#skeletonObject?

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

Returns:

  • (Object, nil)

    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_bitsInteger?

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

Returns:

  • (Integer, nil)

    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_commentString?

Returns Optionally define the comment for the SSH key.

Returns:

  • (String, nil)

    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_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.



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

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.



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

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.



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.

Returns:

  • (:present, :absent, nil)

    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.

Returns:

  • (:yes, :no, nil)

    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

#uidString?

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

Returns:

  • (String, nil)

    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.

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.



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

attribute :update_password