Class: Ansible::Ruby::Modules::Postgresql_user
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Postgresql_user
- 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
-
#db ⇒ String?
Name of database where permissions will be granted.
-
#encrypted ⇒ Boolean?
Whether the password is stored hashed in the database.
-
#expires ⇒ Object?
Sets the user’s password expiration.
-
#fail_on_user ⇒ :yes, ...
If C(yes), fail when user can’t be removed.
-
#login_host ⇒ String?
Host running PostgreSQL.
-
#login_password ⇒ Object?
Password used to authenticate with PostgreSQL.
-
#login_unix_socket ⇒ Object?
Path to a Unix domain socket for local connections.
-
#login_user ⇒ String?
User (role) used to authenticate with PostgreSQL.
-
#name ⇒ String
Name of the user (role) to add or remove.
-
#no_password_changes ⇒ :yes, ...
If C(yes), don’t inspect database for password changes.
-
#password ⇒ String?
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.
-
#port ⇒ Integer?
Database port to connect to.
-
#priv ⇒ Array<String>, ...
PostgreSQL privileges string in the format: C(table:priv1,priv2).
-
#role_attr_flags ⇒ :"[NO]SUPERUSER", ...
PostgreSQL role attributes string in the format: CREATEDB,CREATEROLE,SUPERUSER.
-
#state ⇒ :present, ...
The user (role) state.
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
#db ⇒ String?
Returns 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 |
#encrypted ⇒ Boolean?
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.
59 |
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 59 attribute :encrypted |
#expires ⇒ Object?
Returns 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.
25 |
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 25 attribute :fail_on_user |
#login_host ⇒ String?
Returns Host running PostgreSQL.
40 |
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 40 attribute :login_host |
#login_password ⇒ Object?
Returns 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_socket ⇒ Object?
Returns 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_user ⇒ String?
Returns 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 |
#name ⇒ String
Returns 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.
66 |
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 66 attribute :no_password_changes |
#password ⇒ String?
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.
17 |
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 17 attribute :password |
#port ⇒ Integer?
Returns Database port to connect to.
29 |
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 29 attribute :port |
#priv ⇒ Array<String>, ...
Returns 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.
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.
55 |
# File 'lib/ansible/ruby/modules/generated/core/database/postgresql/postgresql_user.rb', line 55 attribute :state |