Postgresql docs fragments 2 (#55363)

* Postgres to use docsfragments
* Postgres to use docsfragments: redefined options in postgresql_user
pull/49661/head
Andrey Klychkov 6 years ago committed by Alicia Cozine
parent 12d26eceb1
commit c3cbc39dd9

@ -17,7 +17,7 @@ module: postgresql_db
short_description: Add or remove PostgreSQL databases from a remote host. short_description: Add or remove PostgreSQL databases from a remote host.
description: description:
- Add or remove PostgreSQL databases from a remote host. - Add or remove PostgreSQL databases from a remote host.
version_added: "0.6" version_added: '0.6'
options: options:
name: name:
description: description:
@ -58,7 +58,7 @@ options:
- Switch to session_role after connecting. The specified session_role must be a role that the current login_user is a member of. - Switch to session_role after connecting. The specified session_role must be a role that the current login_user is a member of.
- Permissions checking for SQL commands is carried out as though the session_role were the one that had logged in originally. - Permissions checking for SQL commands is carried out as though the session_role were the one that had logged in originally.
type: str type: str
version_added: "2.8" version_added: '2.8'
state: state:
description: description:
- The database state. - The database state.
@ -77,19 +77,19 @@ options:
- File to back up or restore from. - File to back up or restore from.
- Used when I(state) is C(dump) or C(restore). - Used when I(state) is C(dump) or C(restore).
type: path type: path
version_added: "2.4" version_added: '2.4'
target_opts: target_opts:
description: description:
- Further arguments for pg_dump or pg_restore. - Further arguments for pg_dump or pg_restore.
- Used when I(state) is C(dump) or C(restore). - Used when I(state) is C(dump) or C(restore).
type: str type: str
version_added: "2.4" version_added: '2.4'
maintenance_db: maintenance_db:
description: description:
- The value specifies the initial database (which is also called as maintenance DB) that Ansible connects to. - The value specifies the initial database (which is also called as maintenance DB) that Ansible connects to.
type: str type: str
default: postgres default: postgres
version_added: "2.5" version_added: '2.5'
conn_limit: conn_limit:
description: description:
- Specifies the database connection limit. - Specifies the database connection limit.

@ -38,50 +38,6 @@ options:
- Name of the schema to add the extension to. - Name of the schema to add the extension to.
version_added: '2.8' version_added: '2.8'
type: str type: str
login_user:
description:
- The username used to authenticate with.
type: str
default: postgres
login_password:
description:
- The password used to authenticate with.
type: str
login_host:
description:
- Host running the database.
type: str
login_unix_socket:
description:
- Path to a Unix domain socket for local connections.
type: str
version_added: '2.8'
ssl_mode:
description:
- Determines whether or with what priority a secure SSL TCP/IP connection
will be negotiated with the server.
- 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.
default: prefer
choices: [allow, disable, prefer, require, verify-ca, verify-full]
type: str
version_added: '2.8'
ca_cert:
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
version_added: '2.8'
aliases: [ ssl_rootcert ]
port:
description:
- Database port to connect to.
default: 5432
type: int
aliases:
- login_port
session_role: session_role:
description: description:
- Switch to session_role after connecting. - Switch to session_role after connecting.
@ -102,6 +58,27 @@ options:
type: bool type: bool
default: no default: no
version_added: '2.8' version_added: '2.8'
login_unix_socket:
description:
- Path to a Unix domain socket for local connections.
type: str
version_added: '2.8'
ssl_mode:
description:
- Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.
- See 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: [ allow, disable, prefer, require, verify-ca, verify-full ]
version_added: '2.8'
ca_cert:
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
aliases: [ ssl_rootcert ]
version_added: '2.8'
notes: notes:
- The default authentication assumes that you are either logging in as - The default authentication assumes that you are either logging in as
or sudo'ing to the C(postgres) account on the host. or sudo'ing to the C(postgres) account on the host.
@ -115,6 +92,7 @@ requirements: [ psycopg2 ]
author: author:
- Daniel Schep (@dschep) - Daniel Schep (@dschep)
- Thomas O'Donnell (@andytom) - Thomas O'Donnell (@andytom)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -37,18 +37,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
login_user:
description:
- User (role) used to authenticate with PostgreSQL.
type: str
default: postgres
session_role: session_role:
description: description:
- Switch to session_role after connecting. - Switch to session_role after connecting.
@ -60,35 +48,6 @@ options:
description: description:
- Name of a database schema where the index will be created. - Name of a database schema where the index will be created.
type: str type: str
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
will be negotiated with the server.
- 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: [ allow, disable, prefer, require, verify-ca, verify-full ]
ca_cert:
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
aliases: [ ssl_rootcert ]
state: state:
description: description:
- Index state. - Index state.
@ -169,6 +128,7 @@ requirements:
author: author:
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -19,7 +19,7 @@ module: postgresql_info
short_description: Gather information about PostgreSQL servers short_description: Gather information about PostgreSQL servers
description: description:
- Gathers information about PostgreSQL servers. - Gathers information about PostgreSQL servers.
version_added: "2.8" version_added: '2.8'
options: options:
filter: filter:
description: description:
@ -39,13 +39,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
session_role: session_role:
description: description:
- Switch to session_role after connecting. The specified session_role must - Switch to session_role after connecting. The specified session_role must
@ -53,41 +46,6 @@ options:
- Permissions checking for SQL commands is carried out as though - Permissions checking for SQL commands is carried out as though
the session_role were the one that had logged in originally. the session_role were the one that had logged in originally.
type: str type: str
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
will be negotiated with the server.
- 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
choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
default: prefer
ca_cert:
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
aliases: [ ssl_rootcert ]
notes: notes:
- The default authentication assumes that you are either logging in as or - The default authentication assumes that you are either logging in as or
sudo'ing to the postgres account on the host. sudo'ing to the postgres account on the host.
@ -103,6 +61,7 @@ notes:
requirements: [ psycopg2 ] requirements: [ psycopg2 ]
author: author:
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -73,26 +73,6 @@ options:
- Only used when C(state=absent). - Only used when C(state=absent).
type: bool type: bool
default: 'no' default: 'no'
port:
description:
- Database port to connect to.
default: 5432
type: int
aliases:
- login_port
login_user:
description:
- User to authenticate with PostgreSQL.
type: str
default: postgres
login_password:
description:
- Password used to authenticate with PostgreSQL (must match C(login_user)).
type: str
login_host:
description:
- Host running PostgreSQL where you want to execute the actions.
type: str
session_role: session_role:
version_added: '2.8' version_added: '2.8'
description: description:
@ -108,29 +88,25 @@ options:
choices: [ absent, present ] choices: [ absent, present ]
login_unix_socket: login_unix_socket:
description: description:
- Path to a Unix domain socket for local connections. - Path to a Unix domain socket for local connections.
type: str type: str
version_added: '2.8' version_added: '2.8'
ssl_mode: ssl_mode:
description: description:
- Determines whether or with what priority a secure SSL TCP/IP connection - Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.
will be negotiated with the server. - See https://www.postgresql.org/docs/current/static/libpq-ssl.html for more information on the modes.
- See U(https://www.postgresql.org/docs/current/static/libpq-ssl.html) for - Default of C(prefer) matches libpq default.
more information on the modes.
- Default of C(prefer) matches libpq default.
type: str type: str
default: prefer default: prefer
choices: [ allow, disable, prefer, require, verify-ca, verify-full ] choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
version_added: '2.8' version_added: '2.8'
ca_cert: ca_cert:
description: description:
- Specifies the name of a file containing SSL certificate authority (CA) - Specifies the name of a file containing SSL certificate authority (CA) certificate(s).
certificate(s). If the file exists, the server's certificate will be - If the file exists, the server's certificate will be verified to be signed by one of these authorities.
verified to be signed by one of these authorities.
type: str type: str
version_added: '2.8'
aliases: [ ssl_rootcert ] aliases: [ ssl_rootcert ]
version_added: '2.8'
notes: notes:
- The default authentication assumes that you are either logging in as or - The default authentication assumes that you are either logging in as or
sudo'ing to the postgres account on the host. sudo'ing to the postgres account on the host.
@ -145,6 +121,7 @@ requirements: [ psycopg2 ]
author: author:
- Jens Depuydt (@jensdepuydt) - Jens Depuydt (@jensdepuydt)
- Thomas O'Donnell (@andytom) - Thomas O'Donnell (@andytom)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -28,7 +28,7 @@ description:
- 2) grant them desired privileges by M(postgresql_privs) module - 2) grant them desired privileges by M(postgresql_privs) module
U(https://docs.ansible.com/ansible/latest/modules/postgresql_privs_module.html) U(https://docs.ansible.com/ansible/latest/modules/postgresql_privs_module.html)
- 3) add desired PostgreSQL users to the new group (groups) by this module - 3) add desired PostgreSQL users to the new group (groups) by this module
version_added: "2.8" version_added: '2.8'
options: options:
groups: groups:
description: description:
@ -67,18 +67,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
login_user:
description:
- User (role) used to authenticate with PostgreSQL.
type: str
default: postgres
session_role: session_role:
description: description:
- Switch to session_role after connecting. - Switch to session_role after connecting.
@ -86,34 +74,6 @@ options:
- Permissions checking for SQL commands is carried out as though - Permissions checking for SQL commands is carried out as though
the session_role were the one that had logged in originally. the session_role were the one that had logged in originally.
type: str type: str
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
will be negotiated with the server.
- 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: [ allow, disable, prefer, require, verify-ca, verify-full ]
ca_cert:
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
aliases: [ ssl_rootcert ]
notes: notes:
- The default authentication assumes that you are either logging in as or - The default authentication assumes that you are either logging in as or
sudo'ing to the postgres account on the host. sudo'ing to the postgres account on the host.
@ -128,6 +88,7 @@ notes:
requirements: [ psycopg2 ] requirements: [ psycopg2 ]
author: author:
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -67,18 +67,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
login_user:
description:
- User (role) used to authenticate with PostgreSQL.
type: str
default: postgres
session_role: session_role:
description: description:
- Switch to session_role after connecting. - Switch to session_role after connecting.
@ -86,35 +74,6 @@ options:
- Permissions checking for SQL commands is carried out as though - Permissions checking for SQL commands is carried out as though
the session_role were the one that had logged in originally. the session_role were the one that had logged in originally.
type: str type: str
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
will be negotiated with the server.
- 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: [ allow, disable, prefer, require, verify-ca, verify-full ]
ca_cert:
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
aliases: [ ssl_rootcert ]
notes: notes:
- The default authentication assumes that you are either logging in as or - The default authentication assumes that you are either logging in as or
sudo'ing to the postgres account on the host. sudo'ing to the postgres account on the host.
@ -132,6 +91,7 @@ requirements:
author: author:
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -24,7 +24,7 @@ description:
- The lines in the file should be in a typical pg_hba form and lines should be unique per key (type, databases, users, source). - The lines in the file should be in a typical pg_hba form and lines should be unique per key (type, databases, users, source).
If they are not unique and the SID is 'the one to change', only one for C(state=present) or none for C(state=absent) of the SID's will remain. If they are not unique and the SID is 'the one to change', only one for C(state=present) or none for C(state=absent) of the SID's will remain.
extends_documentation_fragment: files extends_documentation_fragment: files
version_added: "2.8" version_added: '2.8'
options: options:
address: address:
description: description:
@ -119,30 +119,30 @@ author: Sebastiaan Mannem (@sebasmannem)
EXAMPLES = ''' EXAMPLES = '''
- name: Grant users joe and simon access to databases sales and logistics from ipv6 localhost ::1/128 using peer authentication. - name: Grant users joe and simon access to databases sales and logistics from ipv6 localhost ::1/128 using peer authentication.
postgresql_pg_hba: postgresql_pg_hba:
dest=/var/lib/postgres/data/pg_hba.conf dest: /var/lib/postgres/data/pg_hba.conf
contype=host contype: host
users=joe,simon users: joe,simon
source=::1 source: ::1
databases=sales,logistics databases: sales,logistics
method=peer method: peer
create=true create: true
- name: Grant user replication from network 192.168.0.100/24 access for replication with client cert authentication. - name: Grant user replication from network 192.168.0.100/24 access for replication with client cert authentication.
postgresql_pg_hba: postgresql_pg_hba:
dest=/var/lib/postgres/data/pg_hba.conf dest: /var/lib/postgres/data/pg_hba.conf
contype=host contype: host
users=replication users: replication
source=192.168.0.100/24 source: 192.168.0.100/24
databases=replication databases: replication
method=cert method: cert
- name: Revoke access from local user mary on database mydb. - name: Revoke access from local user mary on database mydb.
postgresql_pg_hba: postgresql_pg_hba:
dest=/var/lib/postgres/data/pg_hba.conf dest: /var/lib/postgres/data/pg_hba.conf
contype=local contype: local
users=mary users: mary
databases=mydb databases: mydb
state=absent state: absent
''' '''
RETURN = r''' RETURN = r'''

@ -19,7 +19,7 @@ module: postgresql_ping
short_description: Check remote PostgreSQL server availability short_description: Check remote PostgreSQL server availability
description: description:
- Simple module to check remote PostgreSQL server availability. - Simple module to check remote PostgreSQL server availability.
version_added: "2.8" version_added: '2.8'
options: options:
db: db:
description: description:
@ -27,48 +27,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
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
will be negotiated with the server.
- 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
choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
default: prefer
ca_cert:
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
aliases: [ ssl_rootcert ]
notes: notes:
- The default authentication assumes that you are either logging in as or - The default authentication assumes that you are either logging in as or
sudo'ing to the postgres account on the host. sudo'ing to the postgres account on the host.
@ -81,6 +39,7 @@ notes:
requirements: [ psycopg2 ] requirements: [ psycopg2 ]
author: author:
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -21,7 +21,7 @@ short_description: Run PostgreSQL queries
description: description:
- Runs arbitraty PostgreSQL queries. - Runs arbitraty PostgreSQL queries.
- Can run queries from SQL script files. - Can run queries from SQL script files.
version_added: "2.8" version_added: '2.8'
options: options:
query: query:
description: description:
@ -56,48 +56,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
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
will be negotiated with the server.
- 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: [ allow, disable, prefer, require, verify-ca, verify-full ]
ca_cert:
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
aliases: [ ssl_rootcert ]
notes: notes:
- The default authentication assumes that you are either logging in as or - The default authentication assumes that you are either logging in as or
sudo'ing to the postgres account on the host. sudo'ing to the postgres account on the host.
@ -114,6 +72,7 @@ author:
- Felix Archambault (@archf) - Felix Archambault (@archf)
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
- Will Rouesnel (@wrouesnel) - Will Rouesnel (@wrouesnel)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -34,34 +34,10 @@ options:
aliases: aliases:
- db - db
- login_db - login_db
login_user:
description:
- The username used to authenticate with.
type: str
default: postgres
login_password:
description:
- The password used to authenticate with.
type: str
login_host:
description:
- Host running the database.
type: str
login_unix_socket:
description:
- Path to a Unix domain socket for local connections.
type: str
owner: owner:
description: description:
- Name of the role to set as owner of the schema. - Name of the role to set as owner of the schema.
type: str type: str
port:
description:
- Database port to connect to.
type: int
default: 5432
aliases:
- login_port
session_role: session_role:
version_added: '2.8' version_added: '2.8'
description: description:
@ -84,22 +60,20 @@ options:
version_added: '2.8' version_added: '2.8'
ssl_mode: ssl_mode:
description: description:
- Determines whether or with what priority a secure SSL TCP/IP connection - Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.
will be negotiated with the server. - See https://www.postgresql.org/docs/current/static/libpq-ssl.html for more information on the modes.
- See U(https://www.postgresql.org/docs/current/static/libpq-ssl.html) for - Default of C(prefer) matches libpq default.
more information on the modes.
- Default of C(prefer) matches libpq default.
type: str type: str
default: prefer default: prefer
choices: [ allow, disable, prefer, require, verify-ca, verify-full ] choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
version_added: '2.8' version_added: '2.8'
ca_cert: ca_cert:
description: description:
- Specifies the name of a file containing SSL certificate authority (CA) certificate(s). - 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. - If the file exists, the server's certificate will be verified to be signed by one of these authorities.
type: str type: str
version_added: '2.8'
aliases: [ ssl_rootcert ] aliases: [ ssl_rootcert ]
version_added: '2.8'
notes: notes:
- This module uses I(psycopg2), a Python PostgreSQL database adapter. - This module uses I(psycopg2), a Python PostgreSQL database adapter.
- You must ensure that psycopg2 is installed on the host before using this module. - You must ensure that psycopg2 is installed on the host before using this module.
@ -111,6 +85,7 @@ requirements: [ psycopg2 ]
author: author:
- Flavien Chantelot (@Dorn-) <contact@flavien.io> - Flavien Chantelot (@Dorn-) <contact@flavien.io>
- Thomas O'Donnell (@andytom) - Thomas O'Donnell (@andytom)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -29,7 +29,7 @@ description:
string from postgresql.auto.conf and reload I(value=default) (for settings with postmaster context restart is required). string from postgresql.auto.conf and reload I(value=default) (for settings with postmaster context restart is required).
- After change you can see in the ansible output the previous and - After change you can see in the ansible output the previous and
the new parameter value and other information using returned values and M(debug) module. the new parameter value and other information using returned values and M(debug) module.
version_added: "2.8" version_added: '2.8'
options: options:
name: name:
description: description:
@ -62,48 +62,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
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
will be negotiated with the server.
- 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
choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
default: prefer
ca_cert:
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
aliases: [ ssl_rootcert ]
notes: notes:
- Supported version of PostgreSQL is 9.4 and later. - Supported version of PostgreSQL is 9.4 and later.
- Pay attention, change setting with 'postmaster' context can return changed is true - Pay attention, change setting with 'postmaster' context can return changed is true
@ -125,6 +83,7 @@ notes:
requirements: [ psycopg2 ] requirements: [ psycopg2 ]
author: author:
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -67,18 +67,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
login_user:
description:
- User (role) used to authenticate with PostgreSQL.
type: str
default: postgres
session_role: session_role:
description: description:
- Switch to session_role after connecting. - Switch to session_role after connecting.
@ -86,35 +74,6 @@ options:
- Permissions checking for SQL commands is carried out as though - Permissions checking for SQL commands is carried out as though
the session_role were the one that had logged in originally. the session_role were the one that had logged in originally.
type: str type: str
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
will be negotiated with the server.
- 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: [ allow, disable, prefer, require, verify-ca, verify-full ]
ca_cert:
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
aliases:
- ssl_rootcert
notes: notes:
- Physical replication slots were introduced to PostgreSQL with version 9.4, - Physical replication slots were introduced to PostgreSQL with version 9.4,
@ -135,6 +94,7 @@ requirements:
author: author:
- John Scalia (@jscalia) - John Scalia (@jscalia)
- Andew Klychkov (@Andersson007) - Andew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''
@ -340,7 +300,7 @@ def main():
"login_password": "password", "login_password": "password",
"port": "port", "port": "port",
"sslmode": "ssl_mode", "sslmode": "ssl_mode",
"ca_cert": "sslrootcert" "ca_cert": "ssl_rootcert"
} }
kw = dict((params_map[k], v) for (k, v) in module.params.items() kw = dict((params_map[k], v) for (k, v) in module.params.items()
if k in params_map and v != '') if k in params_map and v != '')

@ -86,18 +86,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
login_user:
description:
- User (role) used to authenticate with PostgreSQL.
type: str
default: postgres
session_role: session_role:
description: description:
- Switch to session_role after connecting. - Switch to session_role after connecting.
@ -105,35 +93,6 @@ options:
- Permissions checking for SQL commands is carried out as though - Permissions checking for SQL commands is carried out as though
the session_role were the one that had logged in originally. the session_role were the one that had logged in originally.
type: str type: str
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
will be negotiated with the server.
- 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.
default: prefer
choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
ca_cert:
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
aliases:
- ssl_rootcert
notes: notes:
- If you do not pass db parameter, tables will be created in the database - If you do not pass db parameter, tables will be created in the database
named postgres. named postgres.
@ -153,6 +112,7 @@ notes:
requirements: [ psycopg2 ] requirements: [ psycopg2 ]
author: author:
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -23,7 +23,7 @@ description:
- Adds or removes PostgreSQL tablespaces from remote hosts - Adds or removes PostgreSQL tablespaces from remote hosts
U(https://www.postgresql.org/docs/current/sql-createtablespace.html), U(https://www.postgresql.org/docs/current/sql-createtablespace.html),
U(https://www.postgresql.org/docs/current/manage-ag-tablespaces.html). U(https://www.postgresql.org/docs/current/manage-ag-tablespaces.html).
version_added: "2.8" version_added: '2.8'
options: options:
tablespace: tablespace:
description: description:
@ -78,48 +78,6 @@ options:
type: str type: str
aliases: aliases:
- login_db - login_db
port:
description:
- Database port to connect.
type: int
default: 5432
aliases:
- login_port
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
will be negotiated with the server.
- 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: [ allow, disable, prefer, require, verify-ca, verify-full ]
ca_cert:
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
aliases: [ ssl_rootcert ]
notes: notes:
- I(state=absent) and I(state=present) (the second one if the tablespace doesn't exist) do not - I(state=absent) and I(state=present) (the second one if the tablespace doesn't exist) do not
support check mode because the corresponding PostgreSQL DROP and CREATE TABLESPACE commands support check mode because the corresponding PostgreSQL DROP and CREATE TABLESPACE commands
@ -139,6 +97,7 @@ author:
- Flavien Chantelot (@Dorn-) - Flavien Chantelot (@Dorn-)
- Antoine Levy-Lambert (@antoinell) - Antoine Levy-Lambert (@antoinell)
- Andrew Klychkov (@Andersson007) - Andrew Klychkov (@Andersson007)
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -70,30 +70,6 @@ options:
type: bool type: bool
aliases: aliases:
- fail_on_role - fail_on_role
port:
description:
- Database port to connect to.
type: int
default: 5432
aliases:
- login_port
login_user:
description:
- User (role) used to authenticate with PostgreSQL.
type: str
default: postgres
login_password:
description:
- Password for U(login_user) 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
priv: priv:
description: description:
- "Slash-separated PostgreSQL privileges string: C(priv1/priv2), where - "Slash-separated PostgreSQL privileges string: C(priv1/priv2), where
@ -150,30 +126,27 @@ options:
default: 'no' default: 'no'
type: bool type: bool
version_added: '2.0' version_added: '2.0'
conn_limit:
description:
- Specifies the user (role) connection limit.
type: int
version_added: '2.4'
ssl_mode: ssl_mode:
description: description:
- Determines whether or with what priority a secure SSL TCP/IP connection - Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.
will be negotiated with the server. - See https://www.postgresql.org/docs/current/static/libpq-ssl.html for more information on the modes.
- See U(https://www.postgresql.org/docs/current/static/libpq-ssl.html) for - Default of C(prefer) matches libpq default.
more information on the modes. type: str
- Default of C(prefer) matches libpq default.
default: prefer default: prefer
choices: [ allow, disable, prefer, require, verify-ca, verify-full ] choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
version_added: '2.3' version_added: '2.3'
ca_cert: ca_cert:
description: description:
- Specifies the name of a file containing SSL certificate authority (CA) - Specifies the name of a file containing SSL certificate authority (CA) certificate(s).
certificate(s). If the file exists, the server's certificate will be - If the file exists, the server's certificate will be verified to be signed by one of these authorities.
verified to be signed by one of these authorities.
type: str type: str
version_added: '2.3'
aliases: [ ssl_rootcert ] aliases: [ ssl_rootcert ]
conn_limit: version_added: '2.3'
description:
- Specifies the user (role) connection limit.
type: int
version_added: '2.4'
notes: notes:
- The module creates a user (role) with login privilege by default. - The module creates a user (role) with login privilege by default.
Use NOLOGIN role_attr_flags to change this behaviour. Use NOLOGIN role_attr_flags to change this behaviour.
@ -194,6 +167,7 @@ requirements:
author: author:
- Ansible Core Team - Ansible Core Team
extends_documentation_fragment: postgres
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -29,6 +29,7 @@ options:
- Database port to connect to. - Database port to connect to.
type: int type: int
default: 5432 default: 5432
aliases: [ login_port ]
ssl_mode: ssl_mode:
description: description:
- Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. - Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.
@ -37,13 +38,11 @@ options:
type: str type: str
default: prefer default: prefer
choices: [ allow, disable, prefer, require, verify-ca, verify-full ] choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
version_added: '2.3'
ca_cert: ca_cert:
description: description:
- Specifies the name of a file containing SSL certificate authority (CA) certificate(s). - 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. - If the file exists, the server's certificate will be verified to be signed by one of these authorities.
type: str type: str
version_added: '2.3'
aliases: [ ssl_rootcert ] aliases: [ ssl_rootcert ]
notes: notes:
- The default authentication assumes that you are either logging in as or sudo'ing to the C(postgres) account on the host. - The default authentication assumes that you are either logging in as or sudo'ing to the C(postgres) account on the host.

Loading…
Cancel
Save