mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Sanity fixes in various modules (#50080)
This commit is contained in:
parent
6caed0c38b
commit
15d39f9108
23 changed files with 372 additions and 340 deletions
|
@ -14,7 +14,7 @@ ANSIBLE_METADATA = {
|
|||
}
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
DOCUMENTATION = r'''
|
||||
---
|
||||
module: postgresql_idx
|
||||
short_description: Creates or drops indexes from a PostgreSQL database.
|
||||
|
@ -25,27 +25,34 @@ options:
|
|||
idxname:
|
||||
description:
|
||||
- Name of the index to create or drop.
|
||||
type: str
|
||||
required: true
|
||||
db:
|
||||
description:
|
||||
- Name of database where the index will be created/dropped.
|
||||
type: str
|
||||
port:
|
||||
description:
|
||||
- Database port to connect.
|
||||
type: int
|
||||
default: 5432
|
||||
login_user:
|
||||
description:
|
||||
- User (role) used to authenticate with PostgreSQL.
|
||||
type: str
|
||||
default: postgres
|
||||
login_password:
|
||||
description:
|
||||
- Password used to authenticate with PostgreSQL.
|
||||
type: str
|
||||
login_host:
|
||||
description:
|
||||
- Host running PostgreSQL.
|
||||
type: str
|
||||
login_unix_socket:
|
||||
description:
|
||||
- Path to a Unix domain socket for local connections.
|
||||
type: str
|
||||
ssl_mode:
|
||||
description:
|
||||
- Determines whether or with what priority a secure SSL TCP/IP connection
|
||||
|
@ -53,36 +60,43 @@ options:
|
|||
- See U(https://www.postgresql.org/docs/current/static/libpq-ssl.html) for
|
||||
more information on the modes.
|
||||
- Default of C(prefer) matches libpq default.
|
||||
type: str
|
||||
default: prefer
|
||||
choices: ["disable", "allow", "prefer", "require", "verify-ca", "verify-full"]
|
||||
choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
|
||||
ssl_rootcert:
|
||||
description:
|
||||
- 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.
|
||||
type: str
|
||||
state:
|
||||
description:
|
||||
- Index state.
|
||||
type: str
|
||||
default: present
|
||||
choices: ["present", "absent"]
|
||||
table:
|
||||
description:
|
||||
- Table to create index on it.
|
||||
type: str
|
||||
required: true
|
||||
columns:
|
||||
description:
|
||||
- List of index columns.
|
||||
type: str
|
||||
cond:
|
||||
description:
|
||||
- Index conditions.
|
||||
type: str
|
||||
idxtype:
|
||||
description:
|
||||
- Index type (like btree, gist, gin, etc.).
|
||||
type: str
|
||||
concurrent:
|
||||
description:
|
||||
- Enable or disable concurrent mode (CREATE / DROP INDEX CONCURRENTLY).
|
||||
default: yes
|
||||
type: bool
|
||||
default: yes
|
||||
notes:
|
||||
- The default authentication assumes that you are either logging in as or
|
||||
sudo'ing to the postgres account on the host.
|
||||
|
@ -266,17 +280,17 @@ def index_drop(cursor, module, idxname, concurrent=True):
|
|||
def main():
|
||||
argument_spec = pgutils.postgres_common_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
idxname=dict(required=True, aliases=['idxname']),
|
||||
db=dict(default=''),
|
||||
ssl_mode=dict(default='prefer', choices=[
|
||||
'disable', 'allow', 'prefer', 'require', 'verify-ca', 'verify-full']),
|
||||
ssl_rootcert=dict(default=None),
|
||||
state=dict(default="present", choices=["absent", "present"]),
|
||||
concurrent=dict(type=bool, default="yes"),
|
||||
table=dict(default=None),
|
||||
idxtype=dict(default=None),
|
||||
columns=dict(default=None),
|
||||
cond=dict(default=None)
|
||||
idxname=dict(type='str', required=True, aliases=['idxname']),
|
||||
db=dict(type='str', default=''),
|
||||
ssl_mode=dict(type='str', default='prefer', choices=[
|
||||
'allow', 'disable', 'prefer', 'require', 'verify-ca', 'verify-full']),
|
||||
ssl_rootcert=dict(type='str'),
|
||||
state=dict(type='str', default="present", choices=["absent", "present"]),
|
||||
concurrent=dict(type='bool', default=True),
|
||||
table=dict(type='str'),
|
||||
idxtype=dict(type='str'),
|
||||
columns=dict(type='str'),
|
||||
cond=dict(type='str')
|
||||
))
|
||||
module = AnsibleModule(
|
||||
argument_spec=argument_spec,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue