doc_fragments: Clean up parameter types (database) (#52178)

* module_utils: Clean up parameter types (database)

This PR includes:

- Parameter types added
- Copyright format fixes
- Short license statement
- Description fixes (only for a few files, then I stopped :-))

* Fix validate-modules test ignores
This commit is contained in:
Dag Wieers 2019-02-15 09:32:45 +01:00 committed by John R Barker
parent fbca8a4615
commit 27dfdb6a6a
5 changed files with 61 additions and 52 deletions

View file

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project # Copyright: (c) 2017, Ansible Project
# Copyright: (c) 2017, Abhijeet Kasurde (akasurde@redhat.com) # Copyright: (c) 2017, Abhijeet Kasurde (akasurde@redhat.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@ -5,60 +7,71 @@
class ModuleDocFragment(object): class ModuleDocFragment(object):
# Parameters for influxdb modules # Parameters for influxdb modules
DOCUMENTATION = ''' DOCUMENTATION = r'''
options: options:
hostname: hostname:
description: description:
- The hostname or IP address on which InfluxDB server is listening. - The hostname or IP address on which InfluxDB server is listening.
- Since version 2.5, defaulted to localhost. - Since Ansible 2.5, defaulted to localhost.
type: str
default: localhost default: localhost
username: username:
description: description:
- Username that will be used to authenticate against InfluxDB server. - Username that will be used to authenticate against InfluxDB server.
- Alias C(login_username) added in version 2.5. - Alias C(login_username) added in Ansible 2.5.
type: str
default: root default: root
aliases: [ login_username ] aliases: [ login_username ]
password: password:
description: description:
- Password that will be used to authenticate against InfluxDB server. - Password that will be used to authenticate against InfluxDB server.
- Alias C(login_password) added in version 2.5. - Alias C(login_password) added in Ansible 2.5.
type: str
default: root default: root
aliases: [ login_password ] aliases: [ login_password ]
port: port:
description: description:
- The port on which InfluxDB server is listening - The port on which InfluxDB server is listening
type: int
default: 8086 default: 8086
validate_certs: validate_certs:
description: description:
- If set to C(no), the SSL certificates will not be validated. - If set to C(no), the SSL certificates will not be validated.
- This should only set to C(no) used on personally controlled sites using self-signed certificates. - This should only set to C(no) used on personally controlled sites using self-signed certificates.
default: true type: bool
default: yes
version_added: "2.5" version_added: "2.5"
ssl: ssl:
description: description:
- Use https instead of http to connect to InfluxDB server. - Use https instead of http to connect to InfluxDB server.
type: bool
version_added: "2.5" version_added: "2.5"
timeout: timeout:
description: description:
- Number of seconds Requests will wait for client to establish a connection. - Number of seconds Requests will wait for client to establish a connection.
type: int
version_added: "2.5" version_added: "2.5"
retries: retries:
description: description:
- Number of retries client will try before aborting. - Number of retries client will try before aborting.
- C(0) indicates try until success. - C(0) indicates try until success.
type: int
default: 3 default: 3
version_added: "2.5" version_added: "2.5"
use_udp: use_udp:
description: description:
- Use UDP to connect to InfluxDB server. - Use UDP to connect to InfluxDB server.
type: bool
version_added: "2.5" version_added: "2.5"
udp_port: udp_port:
description: description:
- UDP port to connect to InfluxDB server. - UDP port to connect to InfluxDB server.
type: int
default: 4444 default: 4444
version_added: "2.5" version_added: "2.5"
proxies: proxies:
description: description:
- HTTP(S) proxy to use for Requests to connect to InfluxDB server. - HTTP(S) proxy to use for Requests to connect to InfluxDB server.
type: str
version_added: "2.5" version_added: "2.5"
''' '''

View file

@ -1,67 +1,64 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (c) 2015 Jonathan Mainguy <jon@soh.re>
# # Copyright: (c) 2015, Jonathan Mainguy <jon@soh.re>
# This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
class ModuleDocFragment(object): class ModuleDocFragment(object):
# Standard mysql documentation fragment # Standard mysql documentation fragment
DOCUMENTATION = ''' DOCUMENTATION = r'''
options: options:
login_user: login_user:
description: description:
- The username used to authenticate with. - The username used to authenticate with.
type: str
login_password: login_password:
description: description:
- The password used to authenticate with. - The password used to authenticate with.
type: str
login_host: login_host:
description: description:
- Host running the database. - Host running the database.
type: str
default: localhost default: localhost
login_port: login_port:
description: description:
- Port of the MySQL server. Requires I(login_host) be defined as other than localhost if login_port is used. - Port of the MySQL server. Requires I(login_host) be defined as other than localhost if login_port is used.
type: str
default: 3306 default: 3306
login_unix_socket: login_unix_socket:
description: description:
- The path to a Unix domain socket for local connections. - The path to a Unix domain socket for local connections.
type: str
connect_timeout: connect_timeout:
description: description:
- The connection timeout when connecting to the MySQL server. - The connection timeout when connecting to the MySQL server.
type: int
default: 30 default: 30
version_added: "2.1" version_added: "2.1"
config_file: config_file:
description: description:
- Specify a config file from which user and password are to be read. - Specify a config file from which user and password are to be read.
type: path
default: '~/.my.cnf' default: '~/.my.cnf'
version_added: "2.0" version_added: "2.0"
ssl_ca: ssl_ca:
version_added: "2.0"
description: description:
- The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate - The path to a Certificate Authority (CA) certificate. This option, if used, must specify the same certificate
as used by the server. as used by the server.
ssl_cert: type: path
version_added: "2.0" version_added: "2.0"
ssl_cert:
description: description:
- The path to a client public key certificate. - The path to a client public key certificate.
ssl_key: type: path
version_added: "2.0" version_added: "2.0"
ssl_key:
description: description:
- The path to the client private key. - The path to the client private key.
type: path
version_added: "2.0"
requirements: requirements:
- PyMySQL (Python 2.7 and Python 3.X), or - PyMySQL (Python 2.7 and Python 3.X), or
- MySQLdb (Python 2.x) - MySQLdb (Python 2.x)

View file

@ -1,52 +1,48 @@
# This file is part of Ansible # -*- coding: utf-8 -*-
#
# Ansible is free software: you can redistribute it and/or modify # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
class ModuleDocFragment(object): class ModuleDocFragment(object):
# Postgres documentation fragment # Postgres documentation fragment
DOCUMENTATION = """ DOCUMENTATION = r'''
options: options:
login_user: login_user:
description: description:
- The username used to authenticate with - The username used to authenticate with.
type: str
default: postgres default: postgres
login_password: login_password:
description: description:
- The password used to authenticate with - The password used to authenticate with.
type: str
login_host: login_host:
description: description:
- Host running the database - Host running the database.
type: str
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: path
port: port:
description: description:
- Database port to connect to. - Database port to connect to.
type: int
default: 5432 default: 5432
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.
- See https://www.postgresql.org/docs/current/static/libpq-ssl.html for more information on the modes. - See https://www.postgresql.org/docs/current/static/libpq-ssl.html for more information on the modes.
- Default of C(prefer) matches libpq default. - Default of C(prefer) matches libpq default.
type: str
default: prefer default: prefer
choices: [disable, allow, prefer, require, verify-ca, verify-full] choices: [ allow, disable, prefer, require, verify-ca, verify-full ]
version_added: '2.3' version_added: '2.3'
ssl_rootcert: ssl_rootcert:
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: path
version_added: '2.3' version_added: '2.3'
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.
@ -56,4 +52,4 @@ notes:
and C(python-psycopg2) packages on the remote host before using this module. and C(python-psycopg2) packages on the remote host before using this module.
- The ssl_rootcert parameter requires at least Postgres version 8.4 and I(psycopg2) version 2.4.3. - The ssl_rootcert parameter requires at least Postgres version 8.4 and I(psycopg2) version 2.4.3.
requirements: [ psycopg2 ] requirements: [ psycopg2 ]
""" '''

View file

@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project # Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt
@ -5,26 +7,31 @@
class ModuleDocFragment(object): class ModuleDocFragment(object):
# Documentation fragment for ProxySQL connectivity # Documentation fragment for ProxySQL connectivity
CONNECTIVITY = ''' CONNECTIVITY = r'''
options: options:
login_user: login_user:
description: description:
- The username used to authenticate to ProxySQL admin interface. - The username used to authenticate to ProxySQL admin interface.
type: str
login_password: login_password:
description: description:
- The password used to authenticate to ProxySQL admin interface. - The password used to authenticate to ProxySQL admin interface.
type: str
login_host: login_host:
description: description:
- The host used to connect to ProxySQL admin interface. - The host used to connect to ProxySQL admin interface.
type: str
default: '127.0.0.1' default: '127.0.0.1'
login_port: login_port:
description: description:
- The port used to connect to ProxySQL admin interface. - The port used to connect to ProxySQL admin interface.
type: int
default: 6032 default: 6032
config_file: config_file:
description: description:
- Specify a config file from which I(login_user) and I(login_password) - Specify a config file from which I(login_user) and I(login_password)
are to be read. are to be read.
type: path
default: '' default: ''
requirements: requirements:
- PyMySQL (Python 2.7 and Python 3.X), or - PyMySQL (Python 2.7 and Python 3.X), or
@ -32,7 +39,7 @@ requirements:
''' '''
# Documentation fragment for managing ProxySQL configuration # Documentation fragment for managing ProxySQL configuration
MANAGING_CONFIG = ''' MANAGING_CONFIG = r'''
options: options:
save_to_disk: save_to_disk:
description: description:

View file

@ -363,15 +363,11 @@ lib/ansible/modules/commands/command.py E325
lib/ansible/modules/crypto/openssl_certificate.py E325 lib/ansible/modules/crypto/openssl_certificate.py E325
lib/ansible/modules/crypto/openssl_csr.py E325 lib/ansible/modules/crypto/openssl_csr.py E325
lib/ansible/modules/database/influxdb/influxdb_database.py E324 lib/ansible/modules/database/influxdb/influxdb_database.py E324
lib/ansible/modules/database/influxdb/influxdb_database.py E325
lib/ansible/modules/database/influxdb/influxdb_query.py E324 lib/ansible/modules/database/influxdb/influxdb_query.py E324
lib/ansible/modules/database/influxdb/influxdb_query.py E325
lib/ansible/modules/database/influxdb/influxdb_retention_policy.py E324 lib/ansible/modules/database/influxdb/influxdb_retention_policy.py E324
lib/ansible/modules/database/influxdb/influxdb_retention_policy.py E325 lib/ansible/modules/database/influxdb/influxdb_retention_policy.py E325
lib/ansible/modules/database/influxdb/influxdb_user.py E324 lib/ansible/modules/database/influxdb/influxdb_user.py E324
lib/ansible/modules/database/influxdb/influxdb_user.py E325
lib/ansible/modules/database/influxdb/influxdb_write.py E324 lib/ansible/modules/database/influxdb/influxdb_write.py E324
lib/ansible/modules/database/influxdb/influxdb_write.py E325
lib/ansible/modules/database/misc/riak.py E324 lib/ansible/modules/database/misc/riak.py E324
lib/ansible/modules/database/mongodb/mongodb_parameter.py E317 lib/ansible/modules/database/mongodb/mongodb_parameter.py E317
lib/ansible/modules/database/mongodb/mongodb_parameter.py E323 lib/ansible/modules/database/mongodb/mongodb_parameter.py E323