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/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
-
#conn_limit ⇒ Object?
Specifies the user connection limit.
-
#db ⇒ String?
Name of database where permissions will be granted.
-
#encrypted ⇒ :yes, ...
Whether the password is stored hashed in the database.
-
#expires ⇒ String?
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.
-
#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.,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.
-
#port ⇒ Integer?
Database port to connect to.
-
#priv ⇒ 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.,Note that ‘[NO]CREATEUSER’ is deprecated.
-
#ssl_mode ⇒ :disable, ...
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.
-
#ssl_rootcert ⇒ Object?
Specifies the name of a file containing SSL certificate authority (CA) certificate(s).
-
#state ⇒ :present, ...
The user (role) state.
Methods inherited from Base
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_limit ⇒ Object?
Returns Specifies the user connection limit.
79 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 79 attribute :conn_limit |
#db ⇒ String?
Returns 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.
60 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 60 attribute :encrypted |
#expires ⇒ String?
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.
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.
26 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 26 attribute :fail_on_user |
#login_host ⇒ String?
Returns Host running PostgreSQL.
41 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 41 attribute :login_host |
#login_password ⇒ Object?
Returns 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_socket ⇒ Object?
Returns 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_user ⇒ String?
Returns User (role) used to authenticate with PostgreSQL.
34 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 34 attribute :login_user |
#name ⇒ String
Returns 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.
68 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 68 attribute :no_password_changes |
#password ⇒ String?
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.
18 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 18 attribute :password |
#port ⇒ Integer?
Returns Database port to connect to.
30 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 30 attribute :port |
#priv ⇒ String?
Returns 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.
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.
72 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 72 attribute :ssl_mode |
#ssl_rootcert ⇒ Object?
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.
76 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 76 attribute :ssl_rootcert |
#state ⇒ :present, ...
Returns The user (role) state.
56 |
# File 'lib/ansible/ruby/modules/generated/database/postgresql/postgresql_user.rb', line 56 attribute :state |