From cc3a79bc48be212c843a1599851c04835f8f113d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 24 Feb 2023 09:23:04 +0100 Subject: [PATCH] Add attributes to some database modules (#5953) Add attributes to some database modules. --- plugins/modules/etcd3.py | 11 +++++++++-- plugins/modules/influxdb_database.py | 8 +++++++- plugins/modules/influxdb_query.py | 8 +++++++- plugins/modules/influxdb_retention_policy.py | 8 +++++++- plugins/modules/influxdb_user.py | 8 +++++++- plugins/modules/influxdb_write.py | 8 +++++++- plugins/modules/ldap_attrs.py | 8 +++++++- plugins/modules/ldap_entry.py | 8 +++++++- plugins/modules/ldap_passwd.py | 8 +++++++- plugins/modules/ldap_search.py | 8 +++++++- plugins/modules/mssql_db.py | 9 ++++++++- plugins/modules/mssql_script.py | 11 +++++++++++ plugins/modules/odbc.py | 7 +++++++ plugins/modules/redis.py | 6 ++++++ plugins/modules/redis_data.py | 6 ++++++ plugins/modules/redis_data_incr.py | 17 +++++++++++------ plugins/modules/riak.py | 11 +++++++++-- plugins/modules/vertica_configuration.py | 7 +++++++ plugins/modules/vertica_role.py | 7 +++++++ plugins/modules/vertica_schema.py | 7 +++++++ plugins/modules/vertica_user.py | 7 +++++++ 21 files changed, 158 insertions(+), 20 deletions(-) diff --git a/plugins/modules/etcd3.py b/plugins/modules/etcd3.py index 2a89c71968..9cd0274068 100644 --- a/plugins/modules/etcd3.py +++ b/plugins/modules/etcd3.py @@ -16,8 +16,15 @@ short_description: Set or delete key value pairs from an etcd3 cluster requirements: - etcd3 description: - - Sets or deletes values in etcd3 cluster using its v3 api. - - Needs python etcd3 lib to work + - Sets or deletes values in etcd3 cluster using its v3 api. + - Needs python etcd3 lib to work +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: key: type: str diff --git a/plugins/modules/influxdb_database.py b/plugins/modules/influxdb_database.py index 8ffbece606..046b16e18c 100644 --- a/plugins/modules/influxdb_database.py +++ b/plugins/modules/influxdb_database.py @@ -20,6 +20,11 @@ requirements: - "python >= 2.6" - "influxdb >= 0.9" - requests +attributes: + check_mode: + support: full + diff_mode: + support: none options: database_name: description: @@ -33,7 +38,8 @@ options: default: present type: str extends_documentation_fragment: -- community.general.influxdb + - community.general.influxdb + - community.general.attributes ''' diff --git a/plugins/modules/influxdb_query.py b/plugins/modules/influxdb_query.py index 14a65a60dc..c2e3d8acc4 100644 --- a/plugins/modules/influxdb_query.py +++ b/plugins/modules/influxdb_query.py @@ -18,6 +18,11 @@ author: "René Moser (@resmo)" requirements: - "python >= 2.6" - "influxdb >= 0.9" +attributes: + check_mode: + support: full + diff_mode: + support: none options: query: description: @@ -30,7 +35,8 @@ options: required: true type: str extends_documentation_fragment: -- community.general.influxdb + - community.general.influxdb + - community.general.attributes ''' diff --git a/plugins/modules/influxdb_retention_policy.py b/plugins/modules/influxdb_retention_policy.py index 1b7d7eec9a..28d5450ff0 100644 --- a/plugins/modules/influxdb_retention_policy.py +++ b/plugins/modules/influxdb_retention_policy.py @@ -20,6 +20,11 @@ requirements: - "python >= 2.6" - "influxdb >= 0.9" - requests +attributes: + check_mode: + support: full + diff_mode: + support: none options: database_name: description: @@ -64,7 +69,8 @@ options: type: str version_added: '2.0.0' extends_documentation_fragment: -- community.general.influxdb + - community.general.influxdb + - community.general.attributes ''' diff --git a/plugins/modules/influxdb_user.py b/plugins/modules/influxdb_user.py index 25bc2a95ce..e893fc0759 100644 --- a/plugins/modules/influxdb_user.py +++ b/plugins/modules/influxdb_user.py @@ -20,6 +20,11 @@ author: "Vitaliy Zhhuta (@zhhuta)" requirements: - "python >= 2.6" - "influxdb >= 0.9" +attributes: + check_mode: + support: full + diff_mode: + support: none options: user_name: description: @@ -52,7 +57,8 @@ options: type: list elements: dict extends_documentation_fragment: -- community.general.influxdb + - community.general.influxdb + - community.general.attributes ''' diff --git a/plugins/modules/influxdb_write.py b/plugins/modules/influxdb_write.py index 68e722ae1c..f95b6dae8c 100644 --- a/plugins/modules/influxdb_write.py +++ b/plugins/modules/influxdb_write.py @@ -18,6 +18,11 @@ author: "René Moser (@resmo)" requirements: - "python >= 2.6" - "influxdb >= 0.9" +attributes: + check_mode: + support: none + diff_mode: + support: none options: data_points: description: @@ -31,7 +36,8 @@ options: required: true type: str extends_documentation_fragment: -- community.general.influxdb + - community.general.influxdb + - community.general.attributes ''' diff --git a/plugins/modules/ldap_attrs.py b/plugins/modules/ldap_attrs.py index 61ae291956..01e8c0b9e1 100644 --- a/plugins/modules/ldap_attrs.py +++ b/plugins/modules/ldap_attrs.py @@ -40,6 +40,11 @@ author: - Maciej Delmanowski (@drybjed) requirements: - python-ldap +attributes: + check_mode: + support: full + diff_mode: + support: none options: state: required: false @@ -68,7 +73,8 @@ options: attributes specified in the current task. This is useful mostly with I(olcAccess) attribute to easily manage LDAP Access Control Lists. extends_documentation_fragment: -- community.general.ldap.documentation + - community.general.ldap.documentation + - community.general.attributes ''' diff --git a/plugins/modules/ldap_entry.py b/plugins/modules/ldap_entry.py index 8cacbc42c1..9179b5238b 100644 --- a/plugins/modules/ldap_entry.py +++ b/plugins/modules/ldap_entry.py @@ -30,6 +30,11 @@ author: - Jiri Tyr (@jtyr) requirements: - python-ldap +attributes: + check_mode: + support: full + diff_mode: + support: none options: attributes: description: @@ -59,7 +64,8 @@ options: default: false version_added: 4.6.0 extends_documentation_fragment: -- community.general.ldap.documentation + - community.general.ldap.documentation + - community.general.attributes ''' diff --git a/plugins/modules/ldap_passwd.py b/plugins/modules/ldap_passwd.py index 029b5df252..f47fa330e3 100644 --- a/plugins/modules/ldap_passwd.py +++ b/plugins/modules/ldap_passwd.py @@ -28,13 +28,19 @@ author: - Keller Fuchs (@KellerFuchs) requirements: - python-ldap +attributes: + check_mode: + support: full + diff_mode: + support: none options: passwd: description: - The (plaintext) password to be set for I(dn). type: str extends_documentation_fragment: -- community.general.ldap.documentation + - community.general.ldap.documentation + - community.general.attributes ''' diff --git a/plugins/modules/ldap_search.py b/plugins/modules/ldap_search.py index 02ba4d3529..32efd4edd6 100644 --- a/plugins/modules/ldap_search.py +++ b/plugins/modules/ldap_search.py @@ -27,6 +27,11 @@ author: - Sebastian Pfahl (@eryx12o45) requirements: - python-ldap +attributes: + check_mode: + support: full + diff_mode: + support: none options: dn: required: true @@ -57,7 +62,8 @@ options: - Set to C(true) to return the full attribute schema of entries, not their attribute values. Overrides I(attrs) when provided. extends_documentation_fragment: - - community.general.ldap.documentation + - community.general.ldap.documentation + - community.general.attributes """ EXAMPLES = r""" diff --git a/plugins/modules/mssql_db.py b/plugins/modules/mssql_db.py index 58a8c4dea9..4006033cf2 100644 --- a/plugins/modules/mssql_db.py +++ b/plugins/modules/mssql_db.py @@ -15,7 +15,14 @@ DOCUMENTATION = ''' module: mssql_db short_description: Add or remove MSSQL databases from a remote host description: - - Add or remove MSSQL databases from a remote host. + - Add or remove MSSQL databases from a remote host. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: none + diff_mode: + support: none options: name: description: diff --git a/plugins/modules/mssql_script.py b/plugins/modules/mssql_script.py index 1a5f45736f..1696000db2 100644 --- a/plugins/modules/mssql_script.py +++ b/plugins/modules/mssql_script.py @@ -18,6 +18,17 @@ version_added: "4.0.0" description: - Execute SQL scripts on a MSSQL database. +extends_documentation_fragment: + - community.general.attributes + +attributes: + check_mode: + support: partial + details: + - The script will not be executed in check mode. + diff_mode: + support: none + options: name: description: Database to run script against. diff --git a/plugins/modules/odbc.py b/plugins/modules/odbc.py index 3b6e8ad226..fbc4b63ae5 100644 --- a/plugins/modules/odbc.py +++ b/plugins/modules/odbc.py @@ -16,6 +16,13 @@ version_added: "1.0.0" short_description: Execute SQL via ODBC description: - Read/Write info via ODBC drivers. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: none + diff_mode: + support: none options: dsn: description: diff --git a/plugins/modules/redis.py b/plugins/modules/redis.py index 298b3aaf8c..1778a067e4 100644 --- a/plugins/modules/redis.py +++ b/plugins/modules/redis.py @@ -16,6 +16,12 @@ description: - Unified utility to interact with redis instances. extends_documentation_fragment: - community.general.redis + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: command: description: diff --git a/plugins/modules/redis_data.py b/plugins/modules/redis_data.py index 633afbff54..c0c8dcc9a6 100644 --- a/plugins/modules/redis_data.py +++ b/plugins/modules/redis_data.py @@ -16,6 +16,11 @@ version_added: 3.7.0 description: - Set key value pairs in Redis database. author: "Andreas Botzner (@paginabianca)" +attributes: + check_mode: + support: full + diff_mode: + support: none options: key: description: @@ -59,6 +64,7 @@ options: extends_documentation_fragment: - community.general.redis.documentation + - community.general.attributes seealso: - module: community.general.redis_data_incr diff --git a/plugins/modules/redis_data_incr.py b/plugins/modules/redis_data_incr.py index 4d1c119349..f927fb11f0 100644 --- a/plugins/modules/redis_data_incr.py +++ b/plugins/modules/redis_data_incr.py @@ -17,9 +17,17 @@ description: - Increment integers or float keys in Redis database and get new value. - Default increment for all keys is 1. For specific increments use the I(increment_int) and I(increment_float) options. - - When using I(check_mode) the module will try to calculate the value that - Redis would return. If the key is not present, 0.0 is used as value. author: "Andreas Botzner (@paginabianca)" +attributes: + check_mode: + support: partial + details: + - For C(check_mode) to work, the specified I(redis_user) needs permission to + run the C(GET) command on the key, otherwise the module will fail. + - When using I(check_mode) the module will try to calculate the value that + Redis would return. If the key is not present, 0.0 is used as value. + diff_mode: + support: none options: key: description: @@ -42,10 +50,7 @@ options: extends_documentation_fragment: - community.general.redis.documentation - -notes: - - For C(check_mode) to work, the specified I(redis_user) needs permission to - run the C(GET) command on the key, otherwise the module will fail. + - community.general.attributes seealso: - module: community.general.redis_data diff --git a/plugins/modules/riak.py b/plugins/modules/riak.py index 38f1c33c78..024e5424d2 100644 --- a/plugins/modules/riak.py +++ b/plugins/modules/riak.py @@ -14,11 +14,18 @@ DOCUMENTATION = ''' module: riak short_description: This module handles some common Riak operations description: - - This module can be used to join nodes to a cluster, check - the status of the cluster. + - This module can be used to join nodes to a cluster, check + the status of the cluster. author: - "James Martin (@jsmartin)" - "Drew Kerrigan (@drewkerrigan)" +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: none + diff_mode: + support: none options: command: description: diff --git a/plugins/modules/vertica_configuration.py b/plugins/modules/vertica_configuration.py index 553630da39..09b80df3d7 100644 --- a/plugins/modules/vertica_configuration.py +++ b/plugins/modules/vertica_configuration.py @@ -14,6 +14,13 @@ module: vertica_configuration short_description: Updates Vertica configuration parameters description: - Updates Vertica configuration parameters. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: parameter: description: diff --git a/plugins/modules/vertica_role.py b/plugins/modules/vertica_role.py index dde9919511..704594a128 100644 --- a/plugins/modules/vertica_role.py +++ b/plugins/modules/vertica_role.py @@ -15,6 +15,13 @@ module: vertica_role short_description: Adds or removes Vertica database roles and assigns roles to them description: - Adds or removes Vertica database role and, optionally, assign other roles. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: role: description: diff --git a/plugins/modules/vertica_schema.py b/plugins/modules/vertica_schema.py index 3c4071473a..01f8f721e7 100644 --- a/plugins/modules/vertica_schema.py +++ b/plugins/modules/vertica_schema.py @@ -20,6 +20,13 @@ description: - In such a situation, if the module tries to remove the schema it will fail and only remove roles created for the schema if they have no dependencies. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: schema: description: diff --git a/plugins/modules/vertica_user.py b/plugins/modules/vertica_user.py index 89f1cb92a3..a6a5b59516 100644 --- a/plugins/modules/vertica_user.py +++ b/plugins/modules/vertica_user.py @@ -17,6 +17,13 @@ description: - A user will not be removed until all the dependencies have been dropped. - In such a situation, if the module tries to remove the user it will fail and only remove roles granted to the user. +extends_documentation_fragment: + - community.general.attributes +attributes: + check_mode: + support: full + diff_mode: + support: none options: user: description: