Class: Ansible::Ruby::Modules::Postgresql_user

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb

Overview

Add or remove PostgreSQL users (roles) from a remote host and, optionally, grant the users access to an existing database or tables. The fundamental function of the module is to create, or delete, roles from a PostgreSQL cluster. Privilege assignment, or removal, is an optional step, which works on one database at a time. This allows for the module to be called several times in the same module to modify the permissions on different databases, or to grant permissions to already existing users. A user cannot be removed until all the privileges have been stripped from the user. In such situation, if the module tries to remove the user it will fail. To avoid this from happening the fail_on_user option signals the module to try to remove the user, but if not possible keep going; the module will report if changes happened and separately if the user was removed or not.

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

#dbString?

Returns name of database where permissions will be granted.

Returns:

  • (String, nil)

    name of database where permissions will be granted



21
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 21

attribute :db

#encryptedBoolean?

Returns whether the password is stored hashed in the database. boolean. Passwords can be passed already hashed or unhashed, and postgresql ensures the stored password is hashed when encrypted is set.

Returns:

  • (Boolean, nil)

    whether the password is stored hashed in the database. boolean. Passwords can be passed already hashed or unhashed, and postgresql ensures the stored password is hashed when encrypted is set.



59
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 59

attribute :encrypted

#expiresObject?

Returns sets the user’s password expiration.

Returns:

  • (Object, nil)

    sets the user’s password expiration.



63
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 63

attribute :expires

#fail_on_user:yes, ...

Returns if C(yes), fail when user can’t be removed. Otherwise just log and continue.

Returns:

  • (:yes, :no, nil)

    if C(yes), fail when user can’t be removed. Otherwise just log and continue



25
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 25

attribute :fail_on_user

#login_hostString?

Returns Host running PostgreSQL.

Returns:

  • (String, nil)

    Host running PostgreSQL.



40
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 40

attribute :login_host

#login_passwordObject?

Returns Password used to authenticate with PostgreSQL.

Returns:

  • (Object, nil)

    Password used to authenticate with PostgreSQL



37
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 37

attribute :login_password

#login_unix_socketObject?

Returns Path to a Unix domain socket for local connections.

Returns:

  • (Object, nil)

    Path to a Unix domain socket for local connections



44
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 44

attribute :login_unix_socket

#login_userString?

Returns User (role) used to authenticate with PostgreSQL.

Returns:

  • (String, nil)

    User (role) used to authenticate with PostgreSQL



33
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 33

attribute :login_user

#nameString

Returns name of the user (role) to add or remove.

Returns:

  • (String)

    name of the user (role) to add or remove



13
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 13

attribute :name

#no_password_changes:yes, ...

Returns if C(yes), don’t inspect database for password changes. Effective when C(pg_authid) is not accessible (such as AWS RDS). Otherwise, make password changes as necessary.

Returns:

  • (:yes, :no, nil)

    if C(yes), don’t inspect database for password changes. Effective when C(pg_authid) is not accessible (such as AWS RDS). Otherwise, make password changes as necessary.



66
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 66

attribute :no_password_changes

#passwordString?

Returns set the user’s password, before 1.4 this was required.,When passing an encrypted password, the encrypted parameter must also be true, and it must be generated with the format in the Ansible docs.

Returns:

  • (String, nil)

    set the user’s password, before 1.4 this was required.,When passing an encrypted password, the encrypted parameter must also be true, and it must be generated with the format in the Ansible docs



17
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 17

attribute :password

#portInteger?

Returns Database port to connect to.

Returns:

  • (Integer, nil)

    Database port to connect to.



29
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 29

attribute :port

#privArray<String>, ...

Returns PostgreSQL privileges string in the format: C(table:priv1,priv2).

Returns:

  • (Array<String>, String, nil)

    PostgreSQL privileges string in the format: C(table:priv1,priv2)



47
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 47

attribute :priv

#role_attr_flags:"[NO]SUPERUSER", ...

Returns PostgreSQL role attributes string in the format: CREATEDB,CREATEROLE,SUPERUSER.

Returns:

  • (:"[NO]SUPERUSER", :"[NO]CREATEROLE", :"[NO]CREATEUSER", :"[NO]CREATEDB", :"[NO]INHERIT", :"[NO]LOGIN", :"[NO]REPLICATION", nil)

    PostgreSQL role attributes string in the format: CREATEDB,CREATEROLE,SUPERUSER



51
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 51

attribute :role_attr_flags

#state:present, ...

Returns The user (role) state.

Returns:

  • (:present, :absent, nil)

    The user (role) state



55
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 55

attribute :state