diff --git a/plugins/modules/vdo.py b/plugins/modules/vdo.py index 8b0e745960..c7df2d234c 100644 --- a/plugins/modules/vdo.py +++ b/plugins/modules/vdo.py @@ -8,10 +8,9 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" author: - - Bryan Gurney (@bgurney-rh) + - Bryan Gurney (@bgurney-rh) module: vdo @@ -19,277 +18,189 @@ short_description: Module to control VDO description: - - This module controls the VDO dedupe and compression device. - - VDO, or Virtual Data Optimizer, is a device-mapper target that - provides inline block-level deduplication, compression, and - thin provisioning capabilities to primary storage. - + - This module controls the VDO dedupe and compression device. + - VDO, or Virtual Data Optimizer, is a device-mapper target that provides inline block-level deduplication, compression, and thin provisioning + capabilities to primary storage. extends_documentation_fragment: - - community.general.attributes + - community.general.attributes attributes: - check_mode: - support: none - diff_mode: - support: none + check_mode: + support: none + diff_mode: + support: none options: - name: - description: - - The name of the VDO volume. - type: str - required: true - state: - description: - - Whether this VDO volume should be "present" or "absent". - If a "present" VDO volume does not exist, it will be - created. If a "present" VDO volume already exists, it - will be modified, by updating the configuration, which - will take effect when the VDO volume is restarted. - Not all parameters of an existing VDO volume can be - modified; the "statusparamkeys" list contains the - parameters that can be modified after creation. If an - "absent" VDO volume does not exist, it will not be - removed. - type: str - choices: [ absent, present ] - default: present - activated: - description: - - The "activate" status for a VDO volume. If this is set - to V(false), the VDO volume cannot be started, and it will - not start on system startup. However, on initial - creation, a VDO volume with "activated" set to "off" - will be running, until stopped. This is the default - behavior of the "vdo create" command; it provides the - user an opportunity to write a base amount of metadata - (filesystem, LVM headers, etc.) to the VDO volume prior - to stopping the volume, and leaving it deactivated - until ready to use. - type: bool - running: - description: - - Whether this VDO volume is running. - - A VDO volume must be activated in order to be started. - type: bool - device: - description: - - The full path of the device to use for VDO storage. - - This is required if "state" is "present". - type: str - logicalsize: - description: - - The logical size of the VDO volume (in megabytes, or - LVM suffix format). If not specified for a new volume, - this defaults to the same size as the underlying storage - device, which is specified in the 'device' parameter. - Existing volumes will maintain their size if the - logicalsize parameter is not specified, or is smaller - than or identical to the current size. If the specified - size is larger than the current size, a growlogical - operation will be performed. - type: str - deduplication: - description: - - Configures whether deduplication is enabled. The - default for a created volume is 'enabled'. Existing - volumes will maintain their previously configured - setting unless a different value is specified in the - playbook. - type: str - choices: [ disabled, enabled ] - compression: - description: - - Configures whether compression is enabled. The default - for a created volume is 'enabled'. Existing volumes - will maintain their previously configured setting unless - a different value is specified in the playbook. - type: str - choices: [ disabled, enabled ] - blockmapcachesize: - description: - - The amount of memory allocated for caching block map - pages, in megabytes (or may be issued with an LVM-style - suffix of K, M, G, or T). The default (and minimum) - value is 128M. The value specifies the size of the - cache; there is a 15% memory usage overhead. Each 1.25G - of block map covers 1T of logical blocks, therefore a - small amount of block map cache memory can cache a - significantly large amount of block map data. Existing - volumes will maintain their previously configured - setting unless a different value is specified in the - playbook. - type: str - readcache: - description: - - Enables or disables the read cache. The default is - 'disabled'. Choosing 'enabled' enables a read cache - which may improve performance for workloads of high - deduplication, read workloads with a high level of - compression, or on hard disk storage. Existing - volumes will maintain their previously configured - setting unless a different value is specified in the - playbook. - - The read cache feature is available in VDO 6.1 and older. - type: str - choices: [ disabled, enabled ] - readcachesize: - description: - - Specifies the extra VDO device read cache size in - megabytes. This is in addition to a system-defined - minimum. Using a value with a suffix of K, M, G, or T - is optional. The default value is 0. 1.125 MB of - memory per bio thread will be used per 1 MB of read - cache specified (for example, a VDO volume configured - with 4 bio threads will have a read cache memory usage - overhead of 4.5 MB per 1 MB of read cache specified). - Existing volumes will maintain their previously - configured setting unless a different value is specified - in the playbook. - - The read cache feature is available in VDO 6.1 and older. - type: str - emulate512: - description: - - Enables 512-byte emulation mode, allowing drivers or - filesystems to access the VDO volume at 512-byte - granularity, instead of the default 4096-byte granularity. - Default is 'disabled'; only recommended when a driver - or filesystem requires 512-byte sector level access to - a device. This option is only available when creating - a new volume, and cannot be changed for an existing - volume. - type: bool - default: false - growphysical: - description: - - Specifies whether to attempt to execute a growphysical - operation, if there is enough unused space on the - device. A growphysical operation will be executed if - there is at least 64 GB of free space, relative to the - previous physical size of the affected VDO volume. - type: bool - default: false - slabsize: - description: - - The size of the increment by which the physical size of - a VDO volume is grown, in megabytes (or may be issued - with an LVM-style suffix of K, M, G, or T). Must be a - power of two between 128M and 32G. The default is 2G, - which supports volumes having a physical size up to 16T. - The maximum, 32G, supports a physical size of up to 256T. - This option is only available when creating a new - volume, and cannot be changed for an existing volume. - type: str - writepolicy: - description: - - Specifies the write policy of the VDO volume. The - 'sync' mode acknowledges writes only after data is on - stable storage. The 'async' mode acknowledges writes - when data has been cached for writing to stable - storage. The default (and highly recommended) 'auto' - mode checks the storage device to determine whether it - supports flushes. Devices that support flushes will - result in a VDO volume in 'async' mode, while devices - that do not support flushes will run in sync mode. - Existing volumes will maintain their previously - configured setting unless a different value is - specified in the playbook. - type: str - choices: [ async, auto, sync ] - indexmem: - description: - - Specifies the amount of index memory in gigabytes. The - default is 0.25. The special decimal values 0.25, 0.5, - and 0.75 can be used, as can any positive integer. - This option is only available when creating a new - volume, and cannot be changed for an existing volume. - type: str - indexmode: - description: - - Specifies the index mode of the Albireo index. The - default is 'dense', which has a deduplication window of - 1 GB of index memory per 1 TB of incoming data, - requiring 10 GB of index data on persistent storage. - The 'sparse' mode has a deduplication window of 1 GB of - index memory per 10 TB of incoming data, but requires - 100 GB of index data on persistent storage. This option - is only available when creating a new volume, and cannot - be changed for an existing volume. - type: str - choices: [ dense, sparse ] - ackthreads: - description: - - Specifies the number of threads to use for - acknowledging completion of requested VDO I/O operations. - Valid values are integer values from 1 to 100 (lower - numbers are preferable due to overhead). The default is - 1. Existing volumes will maintain their previously - configured setting unless a different value is specified - in the playbook. - type: str - biothreads: - description: - - Specifies the number of threads to use for submitting I/O - operations to the storage device. Valid values are - integer values from 1 to 100 (lower numbers are - preferable due to overhead). The default is 4. - Existing volumes will maintain their previously - configured setting unless a different value is specified - in the playbook. - type: str - cputhreads: - description: - - Specifies the number of threads to use for CPU-intensive - work such as hashing or compression. Valid values are - integer values from 1 to 100 (lower numbers are - preferable due to overhead). The default is 2. - Existing volumes will maintain their previously - configured setting unless a different value is specified - in the playbook. - type: str - logicalthreads: - description: - - Specifies the number of threads across which to - subdivide parts of the VDO processing based on logical - block addresses. Valid values are integer values from - 1 to 100 (lower numbers are preferable due to overhead). - The default is 1. Existing volumes will maintain their - previously configured setting unless a different value - is specified in the playbook. - type: str - physicalthreads: - description: - - Specifies the number of threads across which to - subdivide parts of the VDO processing based on physical - block addresses. Valid values are integer values from - 1 to 16 (lower numbers are preferable due to overhead). - The physical space used by the VDO volume must be - larger than (slabsize * physicalthreads). The default - is 1. Existing volumes will maintain their previously - configured setting unless a different value is specified - in the playbook. - type: str - force: - description: - - When creating a volume, ignores any existing file system - or VDO signature already present in the storage device. - When stopping or removing a VDO volume, first unmounts - the file system stored on the device if mounted. - - "B(Warning:) Since this parameter removes all safety - checks it is important to make sure that all parameters - provided are accurate and intentional." - type: bool - default: false - version_added: 2.4.0 + name: + description: + - The name of the VDO volume. + type: str + required: true + state: + description: + - Whether this VDO volume should be V(present) or V(absent). If a V(present) VDO volume does not exist, it will be created. If a V(present) + VDO volume already exists, it will be modified, by updating the configuration, which will take effect when the VDO volume is restarted. + Not all parameters of an existing VDO volume can be modified; the C(statusparamkeys) list in the code contains the parameters that can + be modified after creation. If an V(absent) VDO volume does not exist, it will not be removed. + type: str + choices: [absent, present] + default: present + activated: + description: + - The C(activate) status for a VDO volume. If this is set to V(false), the VDO volume cannot be started, and it will not start on system + startup. However, on initial creation, a VDO volume with "activated" set to "off" will be running, until stopped. This is the default + behavior of the C(vdo create) command; it provides the user an opportunity to write a base amount of metadata (filesystem, LVM headers, + etc.) to the VDO volume prior to stopping the volume, and leaving it deactivated until ready to use. + type: bool + running: + description: + - Whether this VDO volume is running. + - A VDO volume must be activated in order to be started. + type: bool + device: + description: + - The full path of the device to use for VDO storage. + - This is required if O(state=present). + type: str + logicalsize: + description: + - The logical size of the VDO volume (in megabytes, or LVM suffix format). If not specified for a new volume, this defaults to the same + size as the underlying storage device, which is specified in the O(device) parameter. Existing volumes will maintain their size if the + logicalsize parameter is not specified, or is smaller than or identical to the current size. If the specified size is larger than the + current size, a C(growlogical) operation will be performed. + type: str + deduplication: + description: + - Configures whether deduplication is enabled. The default for a created volume is V(enabled). Existing volumes will maintain their previously + configured setting unless a different value is specified in the playbook. + type: str + choices: [disabled, enabled] + compression: + description: + - Configures whether compression is enabled. The default for a created volume is V(enabled). Existing volumes will maintain their previously + configured setting unless a different value is specified in the playbook. + type: str + choices: [disabled, enabled] + blockmapcachesize: + description: + - The amount of memory allocated for caching block map pages, in megabytes (or may be issued with an LVM-style suffix of K, M, G, or T). + The default (and minimum) value is V(128M). The value specifies the size of the cache; there is a 15% memory usage overhead. Each 1.25G + of block map covers 1T of logical blocks, therefore a small amount of block map cache memory can cache a significantly large amount of + block map data. + - Existing volumes will maintain their previously configured setting unless a different value is specified in the playbook. + type: str + readcache: + description: + - Enables or disables the read cache. The default is V(disabled). Choosing V(enabled) enables a read cache which may improve performance + for workloads of high deduplication, read workloads with a high level of compression, or on hard disk storage. Existing volumes will maintain + their previously configured setting unless a different value is specified in the playbook. + - The read cache feature is available in VDO 6.1 and older. + type: str + choices: [disabled, enabled] + readcachesize: + description: + - Specifies the extra VDO device read cache size in megabytes. This is in addition to a system-defined minimum. Using a value with a suffix + of K, M, G, or T is optional. The default value is V(0). 1.125 MB of memory per bio thread will be used per 1 MB of read cache specified + (for example, a VDO volume configured with 4 bio threads will have a read cache memory usage overhead of 4.5 MB per 1 MB of read cache + specified). Existing volumes will maintain their previously configured setting unless a different value is specified in the playbook. + - The read cache feature is available in VDO 6.1 and older. + type: str + emulate512: + description: + - Enables 512-byte emulation mode, allowing drivers or filesystems to access the VDO volume at 512-byte granularity, instead of the default + 4096-byte granularity. + - Only recommended when a driver or filesystem requires 512-byte sector level access to a device. + - This option is only available when creating a new volume, and cannot be changed for an existing volume. + type: bool + default: false + growphysical: + description: + - Specifies whether to attempt to execute a C(growphysical) operation, if there is enough unused space on the device. A C(growphysical) + operation will be executed if there is at least 64 GB of free space, relative to the previous physical size of the affected VDO volume. + type: bool + default: false + slabsize: + description: + - The size of the increment by which the physical size of a VDO volume is grown, in megabytes (or may be issued with an LVM-style suffix + of K, M, G, or T). Must be a power of two between 128M and 32G. The default is V(2G), which supports volumes having a physical size up + to 16T. The maximum, V(32G), supports a physical size of up to 256T. This option is only available when creating a new volume, and cannot + be changed for an existing volume. + type: str + writepolicy: + description: + - Specifies the write policy of the VDO volume. + - The V(sync) mode acknowledges writes only after data is on stable storage. + - The V(async) mode acknowledges writes when data has been cached for writing to stable storage. + - The default (and highly recommended) V(auto) mode checks the storage device to determine whether it supports flushes. Devices that support + flushes will result in a VDO volume in V(async) mode, while devices that do not support flushes will run in V(sync) mode. + - Existing volumes will maintain their previously configured setting unless a different value is specified in the playbook. + type: str + choices: [async, auto, sync] + indexmem: + description: + - Specifies the amount of index memory in gigabytes. The default is V(0.25). The special decimal values V(0.25), V(0.5), and V(0.75) can + be used, as can any positive integer. This option is only available when creating a new volume, and cannot be changed for an existing + volume. + type: str + indexmode: + description: + - Specifies the index mode of the Albireo index. + - The default is V(dense), which has a deduplication window of 1 GB of index memory per 1 TB of incoming data, requiring 10 GB of index + data on persistent storage. + - The V(sparse) mode has a deduplication window of 1 GB of index memory per 10 TB of incoming data, but requires 100 GB of index data on + persistent storage. + - This option is only available when creating a new volume, and cannot be changed for an existing volume. + type: str + choices: [dense, sparse] + ackthreads: + description: + - Specifies the number of threads to use for acknowledging completion of requested VDO I/O operations. Valid values are integer values from + V(1) to V(100) (lower numbers are preferable due to overhead). The default is V(1). Existing volumes will maintain their previously configured + setting unless a different value is specified in the playbook. + type: str + biothreads: + description: + - Specifies the number of threads to use for submitting I/O operations to the storage device. Valid values are integer values from V(1) + to V(100) (lower numbers are preferable due to overhead). The default is V(4). Existing volumes will maintain their previously configured + setting unless a different value is specified in the playbook. + type: str + cputhreads: + description: + - Specifies the number of threads to use for CPU-intensive work such as hashing or compression. Valid values are integer values from V(1) + to V(100) (lower numbers are preferable due to overhead). The default is V(2). Existing volumes will maintain their previously configured + setting unless a different value is specified in the playbook. + type: str + logicalthreads: + description: + - Specifies the number of threads across which to subdivide parts of the VDO processing based on logical block addresses. Valid values are + integer values from V(1) to V(100) (lower numbers are preferable due to overhead). The default is V(1). Existing volumes will maintain + their previously configured setting unless a different value is specified in the playbook. + type: str + physicalthreads: + description: + - Specifies the number of threads across which to subdivide parts of the VDO processing based on physical block addresses. Valid values + are integer values from V(1) to V(16) (lower numbers are preferable due to overhead). The physical space used by the VDO volume must be + larger than (O(slabsize) * O(physicalthreads)). The default is V(1). Existing volumes will maintain their previously configured setting + unless a different value is specified in the playbook. + type: str + force: + description: + - When creating a volume, ignores any existing file system or VDO signature already present in the storage device. When stopping or removing + a VDO volume, first unmounts the file system stored on the device if mounted. + - B(Warning:) Since this parameter removes all safety checks it is important to make sure that all parameters provided are accurate and + intentional. + type: bool + default: false + version_added: 2.4.0 notes: - In general, the default thread configuration should be used. requirements: - PyYAML - kmod-kvdo - vdo -''' +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: Create 2 TB VDO volume vdo1 on device /dev/md0 community.general.vdo: name: vdo1 @@ -301,9 +212,9 @@ EXAMPLES = r''' community.general.vdo: name: vdo1 state: absent -''' +""" -RETURN = r'''# ''' +RETURN = r"""# """ from ansible.module_utils.basic import AnsibleModule, missing_required_lib import re diff --git a/plugins/modules/vertica_configuration.py b/plugins/modules/vertica_configuration.py index 09b80df3d7..9ce2e42d15 100644 --- a/plugins/modules/vertica_configuration.py +++ b/plugins/modules/vertica_configuration.py @@ -8,14 +8,13 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: vertica_configuration short_description: Updates Vertica configuration parameters description: - - Updates Vertica configuration parameters. + - Updates Vertica configuration parameters. extends_documentation_fragment: - - community.general.attributes + - community.general.attributes attributes: check_mode: support: full @@ -24,51 +23,49 @@ attributes: options: parameter: description: - - Name of the parameter to update. + - Name of the parameter to update. required: true aliases: [name] type: str value: description: - - Value of the parameter to be set. + - Value of the parameter to be set. type: str db: description: - - Name of the Vertica database. + - Name of the Vertica database. type: str cluster: description: - - Name of the Vertica cluster. + - Name of the Vertica cluster. default: localhost type: str port: description: - - Vertica cluster port to connect to. + - Vertica cluster port to connect to. default: '5433' type: str login_user: description: - - The username used to authenticate with. + - The username used to authenticate with. default: dbadmin type: str login_password: description: - - The password used to authenticate with. + - The password used to authenticate with. type: str notes: - - The default authentication assumes that you are either logging in as or sudo'ing - to the C(dbadmin) account on the host. - - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure - that C(unixODBC) and C(pyodbc) is installed on the host and properly configured. - - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) - to be added to the C(Vertica) section of either C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) - and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) - to be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). -requirements: [ 'unixODBC', 'pyodbc' ] + - The default authentication assumes that you are either logging in as or sudo'ing to the C(dbadmin) account on the host. + - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure that C(unixODBC) and C(pyodbc) is installed on the host and properly + configured. + - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) to be added to the C(Vertica) section of either + C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) to + be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). +requirements: ['unixODBC', 'pyodbc'] author: "Dariusz Owczarek (@dareko)" -''' +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Updating load_balance_policy community.general.vertica_configuration: name=failovertostandbyafter value='8 hours' """ diff --git a/plugins/modules/vertica_info.py b/plugins/modules/vertica_info.py index 93ccc68445..bfb99552a0 100644 --- a/plugins/modules/vertica_info.py +++ b/plugins/modules/vertica_info.py @@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: vertica_info short_description: Gathers Vertica database facts description: @@ -25,8 +24,7 @@ options: default: localhost type: str port: - description: - Database port to connect to. + description: Database port to connect to. default: '5433' type: str db: @@ -43,19 +41,17 @@ options: - The password used to authenticate with. type: str notes: - - The default authentication assumes that you are either logging in as or sudo'ing - to the C(dbadmin) account on the host. - - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure - that C(unixODBC) and C(pyodbc) are installed on the host and properly configured. - - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) - to be added to the C(Vertica) section of either C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) - and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) - to be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). -requirements: [ 'unixODBC', 'pyodbc' ] + - The default authentication assumes that you are either logging in as or sudo'ing to the C(dbadmin) account on the host. + - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure that C(unixODBC) and C(pyodbc) are installed on the host and properly + configured. + - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) to be added to the C(Vertica) section of either + C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) to + be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). +requirements: ['unixODBC', 'pyodbc'] author: "Dariusz Owczarek (@dareko)" -''' +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Gathering vertica facts community.general.vertica_info: db=db_name register: result diff --git a/plugins/modules/vertica_role.py b/plugins/modules/vertica_role.py index a1ef40c7a5..c3e15b4b95 100644 --- a/plugins/modules/vertica_role.py +++ b/plugins/modules/vertica_role.py @@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: vertica_role short_description: Adds or removes Vertica database roles and assigns roles to them description: @@ -64,19 +63,17 @@ options: - The password used to authenticate with. type: str notes: - - The default authentication assumes that you are either logging in as or sudo'ing - to the C(dbadmin) account on the host. - - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure - that C(unixODBC) and C(pyodbc) is installed on the host and properly configured. - - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) - to be added to the C(Vertica) section of either C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) - and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) - to be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). -requirements: [ 'unixODBC', 'pyodbc' ] + - The default authentication assumes that you are either logging in as or sudo'ing to the C(dbadmin) account on the host. + - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure that C(unixODBC) and C(pyodbc) is installed on the host and properly + configured. + - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) to be added to the C(Vertica) section of either + C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) to + be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). +requirements: ['unixODBC', 'pyodbc'] author: "Dariusz Owczarek (@dareko)" -''' +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Creating a new vertica role community.general.vertica_role: name=role_name db=db_name state=present diff --git a/plugins/modules/vertica_schema.py b/plugins/modules/vertica_schema.py index 95e434ef3a..b9e243ec7b 100644 --- a/plugins/modules/vertica_schema.py +++ b/plugins/modules/vertica_schema.py @@ -9,17 +9,13 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: vertica_schema short_description: Adds or removes Vertica database schema and roles description: - - Adds or removes Vertica database schema and, optionally, roles - with schema access privileges. + - Adds or removes Vertica database schema and, optionally, roles with schema access privileges. - A schema will not be removed until all the objects have been dropped. - - 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. + - 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: @@ -78,19 +74,17 @@ options: - The password used to authenticate with. type: str notes: - - The default authentication assumes that you are either logging in as or sudo'ing - to the C(dbadmin) account on the host. - - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure - that C(unixODBC) and C(pyodbc) is installed on the host and properly configured. - - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) - to be added to the C(Vertica) section of either C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) - and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) - to be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). -requirements: [ 'unixODBC', 'pyodbc' ] + - The default authentication assumes that you are either logging in as or sudo'ing to the C(dbadmin) account on the host. + - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure that C(unixODBC) and C(pyodbc) is installed on the host and properly + configured. + - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) to be added to the C(Vertica) section of either + C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) to + be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). +requirements: ['unixODBC', 'pyodbc'] author: "Dariusz Owczarek (@dareko)" -''' +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Creating a new vertica schema community.general.vertica_schema: name=schema_name db=db_name state=present @@ -98,12 +92,7 @@ EXAMPLES = """ community.general.vertica_schema: name=schema_name owner=dbowner db=db_name state=present - name: Creating a new schema with roles - community.general.vertica_schema: - name=schema_name - create_roles=schema_name_all - usage_roles=schema_name_ro,schema_name_rw - db=db_name - state=present + community.general.vertica_schema: name=schema_name create_roles=schema_name_all usage_roles=schema_name_ro,schema_name_rw db=db_name state=present """ import traceback diff --git a/plugins/modules/vertica_user.py b/plugins/modules/vertica_user.py index 7a62bec44c..c73e0d54fd 100644 --- a/plugins/modules/vertica_user.py +++ b/plugins/modules/vertica_user.py @@ -8,15 +8,13 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: vertica_user short_description: Adds or removes Vertica database users and assigns roles description: - Adds or removes Vertica database user and, optionally, assigns roles. - 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. + - 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: @@ -42,9 +40,8 @@ options: password: description: - The user's password encrypted by the MD5 algorithm. - - The password must be generated with the format C("md5" + md5[password + username]), - resulting in a total of 35 characters. An easy way to do this is by querying - the Vertica database with select V('md5'||md5(''\)). + - The password must be generated with the format C("md5" + md5[password + username]), resulting in a total of 35 characters. An easy way + to do this is by querying the Vertica database with select V('md5'||md5(''\)). type: str expired: description: @@ -90,29 +87,22 @@ options: - The password used to authenticate with. type: str notes: - - The default authentication assumes that you are either logging in as or sudo'ing - to the C(dbadmin) account on the host. - - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure - that C(unixODBC) and C(pyodbc) is installed on the host and properly configured. - - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) - to be added to the C(Vertica) section of either C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) - and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) - to be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). -requirements: [ 'unixODBC', 'pyodbc' ] + - The default authentication assumes that you are either logging in as or sudo'ing to the C(dbadmin) account on the host. + - This module uses C(pyodbc), a Python ODBC database adapter. You must ensure that C(unixODBC) and C(pyodbc) is installed on the host and properly + configured. + - Configuring C(unixODBC) for Vertica requires C(Driver = /opt/vertica/lib64/libverticaodbc.so) to be added to the C(Vertica) section of either + C(/etc/odbcinst.ini) or C($HOME/.odbcinst.ini) and both C(ErrorMessagesPath = /opt/vertica/lib64) and C(DriverManagerEncoding = UTF-16) to + be added to the C(Driver) section of either C(/etc/vertica.ini) or C($HOME/.vertica.ini). +requirements: ['unixODBC', 'pyodbc'] author: "Dariusz Owczarek (@dareko)" -''' +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Creating a new vertica user with password community.general.vertica_user: name=user_name password=md5 db=db_name state=present - name: Creating a new vertica user authenticated via ldap with roles assigned - community.general.vertica_user: - name=user_name - ldap=true - db=db_name - roles=schema_name_ro - state=present + community.general.vertica_user: name=user_name ldap=true db=db_name roles=schema_name_ro state=present """ import traceback diff --git a/plugins/modules/vexata_eg.py b/plugins/modules/vexata_eg.py index 457d1fa9ed..f7184d68b0 100644 --- a/plugins/modules/vexata_eg.py +++ b/plugins/modules/vexata_eg.py @@ -9,15 +9,13 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: vexata_eg short_description: Manage export groups on Vexata VX100 storage arrays description: - - Create or delete export groups on a Vexata VX100 array. - - An export group is a tuple of a volume group, initiator group and port - group that allows a set of volumes to be exposed to one or more hosts - through specific array ports. + - Create or delete export groups on a Vexata VX100 array. + - An export group is a tuple of a volume group, initiator group and port group that allows a set of volumes to be exposed to one or more hosts + through specific array ports. author: - Sandeep Kasargod (@vexata) attributes: @@ -33,29 +31,28 @@ options: type: str state: description: - - Creates export group when present or delete when absent. + - Creates export group when present or delete when absent. default: present - choices: [ present, absent ] + choices: [present, absent] type: str vg: description: - - Volume group name. + - Volume group name. type: str ig: description: - - Initiator group name. + - Initiator group name. type: str pg: description: - - Port group name. + - Port group name. type: str extends_documentation_fragment: -- community.general.vexata.vx100 -- community.general.attributes + - community.general.vexata.vx100 + - community.general.attributes +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" - name: Create export group named db_export. community.general.vexata_eg: name: db_export @@ -74,10 +71,10 @@ EXAMPLES = r''' array: vx100_ultra.test.com user: admin password: secret -''' +""" -RETURN = r''' -''' +RETURN = r""" +""" from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.vexata import ( diff --git a/plugins/modules/vexata_volume.py b/plugins/modules/vexata_volume.py index 7fdfc7e5fa..29136eb31e 100644 --- a/plugins/modules/vexata_volume.py +++ b/plugins/modules/vexata_volume.py @@ -9,14 +9,13 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: vexata_volume short_description: Manage volumes on Vexata VX100 storage arrays description: - - Create, deletes or extend volumes on a Vexata VX100 array. + - Create, deletes or extend volumes on a Vexata VX100 array. author: -- Sandeep Kasargod (@vexata) + - Sandeep Kasargod (@vexata) attributes: check_mode: support: full @@ -32,19 +31,18 @@ options: description: - Creates/Modifies volume when present or removes when absent. default: present - choices: [ present, absent ] + choices: [present, absent] type: str size: description: - Volume size in M, G, T units. M=2^20, G=2^30, T=2^40 bytes. type: str extends_documentation_fragment: -- community.general.vexata.vx100 -- community.general.attributes + - community.general.vexata.vx100 + - community.general.attributes +""" -''' - -EXAMPLES = r''' +EXAMPLES = r""" - name: Create new 2 TiB volume named foo community.general.vexata_volume: name: foo @@ -70,10 +68,10 @@ EXAMPLES = r''' array: vx100_ultra.test.com user: admin password: secret -''' +""" -RETURN = r''' -''' +RETURN = r""" +""" from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.vexata import ( diff --git a/plugins/modules/vmadm.py b/plugins/modules/vmadm.py index 923a902bcf..148ca18b86 100644 --- a/plugins/modules/vmadm.py +++ b/plugins/modules/vmadm.py @@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: vmadm short_description: Manage SmartOS virtual machines and zones description: @@ -27,8 +26,7 @@ options: archive_on_delete: required: false description: - - When enabled, the zone dataset will be mounted on C(/zones/archive) - upon removal. + - When enabled, the zone dataset will be mounted on C(/zones/archive) upon removal. type: bool autoboot: required: false @@ -36,7 +34,7 @@ options: - Whether or not a VM is booted when the system is rebooted. type: bool brand: - choices: [ joyent, joyent-minimal, lx, kvm, bhyve ] + choices: [joyent, joyent-minimal, lx, kvm, bhyve] default: joyent description: - Type of virtual machine. The V(bhyve) option was added in community.general 0.2.0. @@ -49,18 +47,16 @@ options: cpu_cap: required: false description: - - Sets a limit on the amount of CPU time that can be used by a VM. - Use V(0) for no cap. + - Sets a limit on the amount of CPU time that can be used by a VM. Use V(0) for no cap. type: int cpu_shares: required: false description: - - Sets a limit on the number of fair share scheduler (FSS) CPU shares for - a VM. This limit is relative to all other VMs on the system. + - Sets a limit on the number of fair share scheduler (FSS) CPU shares for a VM. This limit is relative to all other VMs on the system. type: int cpu_type: required: false - choices: [ qemu64, host ] + choices: [qemu64, host] default: qemu64 description: - Control the type of virtual CPU exposed to KVM VMs. @@ -68,8 +64,7 @@ options: customer_metadata: required: false description: - - Metadata to be set and associated with this VM, this contain customer - modifiable keys. + - Metadata to be set and associated with this VM, this contain customer modifiable keys. type: dict delegate_dataset: required: false @@ -141,14 +136,12 @@ options: internal_metadata: required: false description: - - Metadata to be set and associated with this VM, this contains operator - generated keys. + - Metadata to be set and associated with this VM, this contains operator generated keys. type: dict internal_metadata_namespace: required: false description: - - List of namespaces to be set as C(internal_metadata-only); these namespaces - will come from O(internal_metadata) rather than O(customer_metadata). + - List of namespaces to be set as C(internal_metadata-only); these namespaces will come from O(internal_metadata) rather than O(customer_metadata). type: str kernel_version: required: false @@ -163,8 +156,7 @@ options: maintain_resolvers: required: false description: - - Resolvers in C(/etc/resolv.conf) will be updated when updating - the O(resolvers) property. + - Resolvers in C(/etc/resolv.conf) will be updated when updating the O(resolvers) property. type: bool max_locked_memory: required: false @@ -189,12 +181,11 @@ options: mdata_exec_timeout: required: false description: - - Timeout in seconds (or 0 to disable) for the C(svc:/smartdc/mdata:execute) service - that runs user-scripts in the zone. + - Timeout in seconds (or 0 to disable) for the C(svc:/smartdc/mdata:execute) service that runs user-scripts in the zone. type: int name: required: false - aliases: [ alias ] + aliases: [alias] description: - Name of the VM. vmadm(1M) uses this as an optional name. type: str @@ -212,14 +203,12 @@ options: nowait: required: false description: - - Consider the provisioning complete when the VM first starts, rather than - when the VM has rebooted. + - Consider the provisioning complete when the VM first starts, rather than when the VM has rebooted. type: bool qemu_opts: required: false description: - - Additional qemu arguments for KVM guests. This overwrites the default arguments - provided by vmadm(1M) and should only be used for debugging. + - Additional qemu arguments for KVM guests. This overwrites the default arguments provided by vmadm(1M) and should only be used for debugging. type: str qemu_extra_opts: required: false @@ -245,8 +234,7 @@ options: routes: required: false description: - - Dictionary that maps destinations to gateways, these will be set as static - routes in the VM. + - Dictionary that maps destinations to gateways, these will be set as static routes in the VM. type: dict spice_opts: required: false @@ -256,19 +244,15 @@ options: spice_password: required: false description: - - Password required to connect to SPICE. By default no password is set. - Please note this can be read from the Global Zone. + - Password required to connect to SPICE. By default no password is set. Please note this can be read from the Global Zone. type: str state: - choices: [ present, running, absent, deleted, stopped, created, restarted, rebooted ] + choices: [present, running, absent, deleted, stopped, created, restarted, rebooted] default: running description: - - States for the VM to be in. Please note that V(present), V(stopped) and V(restarted) - operate on a VM that is currently provisioned. V(present) means that the VM will be - created if it was absent, and that it will be in a running state. V(absent) will - shutdown the zone before removing it. - V(stopped) means the zone will be created if it does not exist already, before shutting - it down. + - States for the VM to be in. Please note that V(present), V(stopped) and V(restarted) operate on a VM that is currently provisioned. V(present) + means that the VM will be created if it was absent, and that it will be in a running state. V(absent) will shutdown the zone before removing + it. V(stopped) means the zone will be created if it does not exist already, before shutting it down. type: str tmpfs: required: false @@ -303,20 +287,17 @@ options: vnc_password: required: false description: - - Password required to connect to VNC. By default no password is set. - Please note this can be read from the Global Zone. + - Password required to connect to VNC. By default no password is set. Please note this can be read from the Global Zone. type: str vnc_port: required: false description: - - TCP port to listen of the VNC server. Or set V(0) for random, - or V(-1) to disable. + - TCP port to listen of the VNC server. Or set V(0) for random, or V(-1) to disable. type: int zfs_data_compression: required: false description: - - Specifies compression algorithm used for this VMs data dataset. This option - only has effect on delegated datasets. + - Specifies compression algorithm used for this VMs data dataset. This option only has effect on delegated datasets. type: str zfs_data_recsize: required: false @@ -336,8 +317,7 @@ options: zfs_root_compression: required: false description: - - Specifies compression algorithm used for this VMs root dataset. This option - only has effect on the zoneroot dataset. + - Specifies compression algorithm used for this VMs root dataset. This option only has effect on the zoneroot dataset. type: str zfs_root_recsize: required: false @@ -354,9 +334,9 @@ options: description: - ZFS pool the VM's zone dataset will be created in. type: str -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Create SmartOS zone community.general.vmadm: brand: joyent @@ -382,9 +362,9 @@ EXAMPLES = ''' community.general.vmadm: uuid: '*' state: stopped -''' +""" -RETURN = ''' +RETURN = r""" uuid: description: UUID of the managed VM. returned: always @@ -400,7 +380,7 @@ state: returned: success type: str sample: 'running' -''' +""" import json import os diff --git a/plugins/modules/wakeonlan.py b/plugins/modules/wakeonlan.py index 6d7e094527..235be741a7 100644 --- a/plugins/modules/wakeonlan.py +++ b/plugins/modules/wakeonlan.py @@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = r''' ---- +DOCUMENTATION = r""" module: wakeonlan short_description: Send a magic Wake-on-LAN (WoL) broadcast packet description: @@ -25,17 +24,17 @@ attributes: options: mac: description: - - MAC address to send Wake-on-LAN broadcast packet for. + - MAC address to send Wake-on-LAN broadcast packet for. required: true type: str broadcast: description: - - Network broadcast address to use for broadcasting magic Wake-on-LAN packet. + - Network broadcast address to use for broadcasting magic Wake-on-LAN packet. default: 255.255.255.255 type: str port: description: - - UDP port to use for magic Wake-on-LAN packet. + - UDP port to use for magic Wake-on-LAN packet. default: 7 type: int todo: @@ -43,16 +42,16 @@ todo: - Enable check-mode support (when we have arping support) - Does not have SecureOn password support notes: - - This module sends a magic packet, without knowing whether it worked - - Only works if the target system was properly configured for Wake-on-LAN (in the BIOS and/or the OS) + - This module sends a magic packet, without knowing whether it worked. + - Only works if the target system was properly configured for Wake-on-LAN (in the BIOS and/or the OS). - Some BIOSes have a different (configurable) Wake-on-LAN boot order (i.e. PXE first). seealso: -- module: community.windows.win_wakeonlan + - module: community.windows.win_wakeonlan author: -- Dag Wieers (@dagwieers) -''' + - Dag Wieers (@dagwieers) +""" -EXAMPLES = r''' +EXAMPLES = r""" - name: Send a magic Wake-on-LAN packet to 00:00:5E:00:53:66 community.general.wakeonlan: mac: '00:00:5E:00:53:66' @@ -63,11 +62,11 @@ EXAMPLES = r''' mac: 00:00:5E:00:53:66 port: 9 delegate_to: localhost -''' +""" -RETURN = r''' +RETURN = r""" # Default return values -''' +""" import socket import struct import traceback diff --git a/plugins/modules/wdc_redfish_command.py b/plugins/modules/wdc_redfish_command.py index 93c4811afe..680bd4b3f9 100644 --- a/plugins/modules/wdc_redfish_command.py +++ b/plugins/modules/wdc_redfish_command.py @@ -8,14 +8,12 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: wdc_redfish_command short_description: Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs version_added: 5.4.0 description: - - Builds Redfish URIs locally and sends them to remote OOB controllers to - perform an action. + - Builds Redfish URIs locally and sends them to remote OOB controllers to perform an action. - Manages OOB controller firmware. For example, Firmware Activate, Update and Activate. extends_documentation_fragment: - community.general.attributes @@ -38,11 +36,11 @@ options: elements: str baseuri: description: - - Base URI of OOB controller. Must include this or O(ioms). + - Base URI of OOB controller. Must include this or O(ioms). type: str ioms: description: - - List of IOM FQDNs for the enclosure. Must include this or O(baseuri). + - List of IOM FQDNs for the enclosure. Must include this or O(baseuri). type: list elements: str username: @@ -90,14 +88,12 @@ options: - The password for retrieving the update image. type: str notes: - - In the inventory, you can specify baseuri or ioms. See the EXAMPLES section. - - ioms is a list of FQDNs for the enclosure's IOMs. - - + - In the inventory, you can specify baseuri or ioms. See the EXAMPLES section. + - Ioms is a list of FQDNs for the enclosure's IOMs. author: Mike Moerk (@mikemoerk) -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Firmware Activate (required after SimpleUpdate to apply the new firmware) community.general.wdc_redfish_command: category: Update @@ -188,16 +184,15 @@ EXAMPLES = ''' category: Chassis resource_id: Enclosure command: PowerModeNormal +""" -''' - -RETURN = ''' +RETURN = r""" msg: - description: Message with action result or error description - returned: always - type: str - sample: "Action was successful" -''' + description: Message with action result or error description. + returned: always + type: str + sample: "Action was successful" +""" from ansible_collections.community.general.plugins.module_utils.wdc_redfish_utils import WdcRedfishUtils from ansible.module_utils.basic import AnsibleModule diff --git a/plugins/modules/wdc_redfish_info.py b/plugins/modules/wdc_redfish_info.py index 03ae67fcfe..caaa9c7fd9 100644 --- a/plugins/modules/wdc_redfish_info.py +++ b/plugins/modules/wdc_redfish_info.py @@ -8,14 +8,12 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: wdc_redfish_info short_description: Manages WDC UltraStar Data102 Out-Of-Band controllers using Redfish APIs version_added: 5.4.0 description: - - Builds Redfish URIs locally and sends them to remote OOB controllers to - get information back. + - Builds Redfish URIs locally and sends them to remote OOB controllers to get information back. extends_documentation_fragment: - community.general.attributes - community.general.attributes.info_module @@ -33,11 +31,11 @@ options: elements: str baseuri: description: - - Base URI of OOB controller. Must include this or O(ioms). + - Base URI of OOB controller. Must include this or O(ioms). type: str ioms: description: - - List of IOM FQDNs for the enclosure. Must include this or O(baseuri). + - List of IOM FQDNs for the enclosure. Must include this or O(baseuri). type: list elements: str username: @@ -59,13 +57,12 @@ options: type: int notes: - - In the inventory, you can specify baseuri or ioms. See the EXAMPLES section. - - ioms is a list of FQDNs for the enclosure's IOMs. - + - In the inventory, you can specify baseuri or ioms. See the EXAMPLES section. + - Ioms is a list of FQDNs for the enclosure's IOMs. author: Mike Moerk (@mikemoerk) -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Get Simple Update Status with individual IOMs specified community.general.wdc_redfish_info: category: Update @@ -93,30 +90,30 @@ EXAMPLES = ''' - name: Print fetched information ansible.builtin.debug: msg: "{{ result.redfish_facts.simple_update_status.entries | to_nice_json }}" -''' +""" -RETURN = ''' +RETURN = r""" Description: - description: Firmware update status description. - returned: always - type: str - sample: Ready for FW update + description: Firmware update status description. + returned: always + type: str + sample: Ready for FW update ErrorCode: - description: Numeric error code for firmware update status. Non-zero indicates an error condition. - returned: always - type: int - sample: 0 + description: Numeric error code for firmware update status. Non-zero indicates an error condition. + returned: always + type: int + sample: 0 EstimatedRemainingMinutes: - description: Estimated number of minutes remaining in firmware update operation. - returned: always - type: int - sample: 20 + description: Estimated number of minutes remaining in firmware update operation. + returned: always + type: int + sample: 20 StatusCode: - description: Firmware update status code. - returned: always - type: int - sample: 2 -''' + description: Firmware update status code. + returned: always + type: int + sample: 2 +""" from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native