Sanity fixes in various modules (#50080)

This commit is contained in:
Dag Wieers 2018-12-18 16:53:46 +01:00 committed by Adam Miller
parent 6caed0c38b
commit 15d39f9108
23 changed files with 372 additions and 340 deletions

View file

@ -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,