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

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/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, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#conn_limitObject?

Returns Specifies the user connection limit.

Returns:

  • (Object, nil)

    Specifies the user connection limit.



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

attribute :conn_limit

#dbString?

Returns Name of database where permissions will be granted.

Returns:

  • (String, nil)

    Name of database where permissions will be granted.



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

attribute :db

#encrypted:yes, ...

Returns Whether the password is stored hashed in the database. Passwords can be passed already hashed or unhashed, and postgresql ensures the stored password is hashed when C(encrypted) is set.,Note: Postgresql 10 and newer doesn’t support unhashed passwords.,Previous to Ansible 2.6, this was C(no) by default.

Returns:

  • (:yes, :no, nil)

    Whether the password is stored hashed in the database. Passwords can be passed already hashed or unhashed, and postgresql ensures the stored password is hashed when C(encrypted) is set.,Note: Postgresql 10 and newer doesn’t support unhashed passwords.,Previous to Ansible 2.6, this was C(no) by default.



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

attribute :encrypted

#expiresString?

Returns The date at which the user’s password is to expire.,If set to C(‘infinity’), user’s password never expire.,Note that this value should be a valid SQL date and time type.

Returns:

  • (String, nil)

    The date at which the user’s password is to expire.,If set to C(‘infinity’), user’s password never expire.,Note that this value should be a valid SQL date and time type.



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

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.



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

attribute :fail_on_user

#login_hostString?

Returns Host running PostgreSQL.

Returns:

  • (String, nil)

    Host running PostgreSQL.



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

attribute :login_host

#login_passwordObject?

Returns Password used to authenticate with PostgreSQL.

Returns:

  • (Object, nil)

    Password used to authenticate with PostgreSQL.



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

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.



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

attribute :login_unix_socket

#login_userString?

Returns User (role) used to authenticate with PostgreSQL.

Returns:

  • (String, nil)

    User (role) used to authenticate with PostgreSQL.



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

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.



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

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.



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

attribute :no_password_changes

#passwordString?

Returns Set the user’s password, before 1.4 this was required.,Password can be passed unhashed or hashed (MD5-hashed).,Unhashed password will automatically be hashed when saved into the database if C(encrypted) parameter is set, otherwise it will be save in plain text format.,When passing a hashed password it must be generated with the format C(‘str + md5[ password + username ]’), resulting in a total of 35 characters. An easy way to do this is C(echo “md5$(echo -n ‘verysecretpasswordJOE’ | md5sum)”).,Note that if the provided password string is already in MD5-hashed format, then it is used as-is, regardless of C(encrypted) parameter.

Returns:

  • (String, nil)

    Set the user’s password, before 1.4 this was required.,Password can be passed unhashed or hashed (MD5-hashed).,Unhashed password will automatically be hashed when saved into the database if C(encrypted) parameter is set, otherwise it will be save in plain text format.,When passing a hashed password it must be generated with the format C(‘str + md5[ password + username ]’), resulting in a total of 35 characters. An easy way to do this is C(echo “md5$(echo -n ‘verysecretpasswordJOE’ | md5sum)”).,Note that if the provided password string is already in MD5-hashed format, then it is used as-is, regardless of C(encrypted) parameter.



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

attribute :password

#portInteger?

Returns Database port to connect to.

Returns:

  • (Integer, nil)

    Database port to connect to.



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

attribute :port

#privString?

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

Returns:

  • (String, nil)

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



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

attribute :priv

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

Returns PostgreSQL role attributes string in the format: CREATEDB,CREATEROLE,SUPERUSER.,Note that ‘[NO]CREATEUSER’ is deprecated.

Returns:

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

    PostgreSQL role attributes string in the format: CREATEDB,CREATEROLE,SUPERUSER.,Note that ‘[NO]CREATEUSER’ is deprecated.



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

attribute :role_attr_flags

#ssl_mode:disable, ...

Returns Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.,See U(www.postgresql.org/docs/current/static/libpq-ssl.html) for more information on the modes.,Default of C(prefer) matches libpq default.

Returns:

  • (:disable, :allow, :prefer, :require, :"verify-ca", :"verify-full", nil)

    Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.,See U(www.postgresql.org/docs/current/static/libpq-ssl.html) for more information on the modes.,Default of C(prefer) matches libpq default.



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

attribute :ssl_mode

#ssl_rootcertObject?

Returns Specifies the name of a file containing SSL certificate authority (CA) certificate(s). If the file exists, the server’s certificate will be verified to be signed by one of these authorities.

Returns:

  • (Object, nil)

    Specifies the name of a file containing SSL certificate authority (CA) certificate(s). If the file exists, the server’s certificate will be verified to be signed by one of these authorities.



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

attribute :ssl_rootcert

#state:present, ...

Returns The user (role) state.

Returns:

  • (:present, :absent, nil)

    The user (role) state.



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

attribute :state