1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

sanity: Fix sanity check for modules (#587)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2020-07-31 14:27:57 +05:30 committed by GitHub
parent 623817b0b7
commit 291ceffecb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 46 deletions

View file

@ -8,13 +8,13 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: atomic_container module: atomic_container
short_description: Manage the containers on the atomic host platform short_description: Manage the containers on the atomic host platform
description: description:
- Manage the containers on the atomic host platform - Manage the containers on the atomic host platform.
- Allows to manage the lifecycle of a container on the atomic host platform - Allows to manage the lifecycle of a container on the atomic host platform.
author: "Giuseppe Scrivano (@giuseppe)" author: "Giuseppe Scrivano (@giuseppe)"
notes: notes:
- Host should support C(atomic) command - Host should support C(atomic) command
@ -24,38 +24,47 @@ requirements:
options: options:
backend: backend:
description: description:
- Define the backend to use for the container - Define the backend to use for the container.
required: True required: True
choices: ["docker", "ostree"] choices: ["docker", "ostree"]
type: str
name: name:
description: description:
- Name of the container - Name of the container.
required: True required: True
type: str
image: image:
description: description:
- The image to use to install the container - The image to use to install the container.
required: True required: True
type: str
rootfs: rootfs:
description: description:
- Define the rootfs of the image - Define the rootfs of the image.
type: str
state: state:
description: description:
- State of the container - State of the container.
required: True required: True
choices: ["latest", "present", "absent", "rollback"] choices: ["absent", "latest", "present", "rollback"]
default: "latest" default: "latest"
type: str
mode: mode:
description: description:
- Define if it is an user or a system container - Define if it is an user or a system container.
required: True required: True
choices: ["user", "system"] choices: ["user", "system"]
type: str
values: values:
description: description:
- Values for the installation of the container. This option is permitted only with mode 'user' or 'system'. - Values for the installation of the container.
The values specified here will be used at installation time as --set arguments for atomic install. - This option is permitted only with mode 'user' or 'system'.
- The values specified here will be used at installation time as --set arguments for atomic install.
type: list
elements: str
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Install the etcd system container - name: Install the etcd system container
community.general.atomic_container: community.general.atomic_container:
@ -76,7 +85,7 @@ EXAMPLES = '''
mode: system mode: system
''' '''
RETURN = ''' RETURN = r'''
msg: msg:
description: The command standard output description: The command standard output
returned: always returned: always
@ -174,12 +183,12 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
mode=dict(default=None, choices=['user', 'system']), mode=dict(default=None, choices=['user', 'system']),
name=dict(default=None, required=True), name=dict(required=True),
image=dict(default=None, required=True), image=dict(required=True),
rootfs=dict(default=None), rootfs=dict(default=None),
state=dict(default='latest', choices=['present', 'absent', 'latest', 'rollback']), state=dict(default='latest', choices=['present', 'absent', 'latest', 'rollback']),
backend=dict(default=None, required=True, choices=['docker', 'ostree']), backend=dict(required=True, choices=['docker', 'ostree']),
values=dict(type='list', default=[]), values=dict(type='list', default=[], elements='str'),
), ),
) )

View file

@ -7,7 +7,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: atomic_host module: atomic_host
short_description: Manage the atomic host platform short_description: Manage the atomic host platform
@ -24,12 +24,14 @@ requirements:
options: options:
revision: revision:
description: description:
- The version number of the atomic host to be deployed. Providing C(latest) will upgrade to the latest available version. - The version number of the atomic host to be deployed.
default: latest - Providing C(latest) will upgrade to the latest available version.
default: 'latest'
aliases: [ version ] aliases: [ version ]
type: str
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Upgrade the atomic host platform to the latest version (atomic host upgrade) - name: Upgrade the atomic host platform to the latest version (atomic host upgrade)
community.general.atomic_host: community.general.atomic_host:
revision: latest revision: latest
@ -39,7 +41,7 @@ EXAMPLES = '''
revision: 23.130 revision: 23.130
''' '''
RETURN = ''' RETURN = r'''
msg: msg:
description: The command standard output description: The command standard output
returned: always returned: always

View file

@ -7,7 +7,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: atomic_image module: atomic_image
short_description: Manage the container images on the atomic host platform short_description: Manage the container images on the atomic host platform
@ -25,17 +25,20 @@ options:
backend: backend:
description: description:
- Define the backend where the image is pulled. - Define the backend where the image is pulled.
choices: [ docker, ostree ] choices: [ 'docker', 'ostree' ]
type: str
name: name:
description: description:
- Name of the container image. - Name of the container image.
required: True required: True
type: str
state: state:
description: description:
- The state of the container image. - The state of the container image.
- The state C(latest) will ensure container image is upgraded to the latest version and forcefully restart container, if running. - The state C(latest) will ensure container image is upgraded to the latest version and forcefully restart container, if running.
choices: [ absent, latest, present ] choices: [ 'absent', 'latest', 'present' ]
default: latest default: 'latest'
type: str
started: started:
description: description:
- Start or Stop the container. - Start or Stop the container.
@ -43,7 +46,7 @@ options:
default: 'yes' default: 'yes'
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Execute the run command on rsyslog container image (atomic run rhel7/rsyslog) - name: Execute the run command on rsyslog container image (atomic run rhel7/rsyslog)
community.general.atomic_image: community.general.atomic_image:
name: rhel7/rsyslog name: rhel7/rsyslog
@ -56,7 +59,7 @@ EXAMPLES = '''
backend: ostree backend: ostree
''' '''
RETURN = ''' RETURN = r'''
msg: msg:
description: The command standard output description: The command standard output
returned: always returned: always

View file

@ -2,13 +2,7 @@ plugins/callback/hipchat.py pylint:blacklisted-name
plugins/connection/lxc.py pylint:blacklisted-name plugins/connection/lxc.py pylint:blacklisted-name
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/modules/cloud/atomic/atomic_container.py validate-modules:doc-missing-type
plugins/modules/cloud/atomic/atomic_container.py validate-modules:doc-required-mismatch plugins/modules/cloud/atomic/atomic_container.py validate-modules:doc-required-mismatch
plugins/modules/cloud/atomic/atomic_container.py validate-modules:no-default-for-required-parameter
plugins/modules/cloud/atomic/atomic_container.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/atomic/atomic_container.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/atomic/atomic_host.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/atomic/atomic_image.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/centurylink/clc_aa_policy.py validate-modules:doc-missing-type plugins/modules/cloud/centurylink/clc_aa_policy.py validate-modules:doc-missing-type
plugins/modules/cloud/centurylink/clc_aa_policy.py yamllint:unparsable-with-libyaml plugins/modules/cloud/centurylink/clc_aa_policy.py yamllint:unparsable-with-libyaml
plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:doc-missing-type plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:doc-missing-type

View file

@ -2,13 +2,7 @@ plugins/callback/hipchat.py pylint:blacklisted-name
plugins/connection/lxc.py pylint:blacklisted-name plugins/connection/lxc.py pylint:blacklisted-name
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/modules/cloud/atomic/atomic_container.py validate-modules:doc-missing-type
plugins/modules/cloud/atomic/atomic_container.py validate-modules:doc-required-mismatch plugins/modules/cloud/atomic/atomic_container.py validate-modules:doc-required-mismatch
plugins/modules/cloud/atomic/atomic_container.py validate-modules:no-default-for-required-parameter
plugins/modules/cloud/atomic/atomic_container.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/atomic/atomic_container.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/atomic/atomic_host.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/atomic/atomic_image.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/centurylink/clc_aa_policy.py validate-modules:doc-missing-type plugins/modules/cloud/centurylink/clc_aa_policy.py validate-modules:doc-missing-type
plugins/modules/cloud/centurylink/clc_aa_policy.py yamllint:unparsable-with-libyaml plugins/modules/cloud/centurylink/clc_aa_policy.py yamllint:unparsable-with-libyaml
plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:doc-missing-type plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:doc-missing-type

View file

@ -2,11 +2,6 @@ plugins/callback/hipchat.py pylint:blacklisted-name
plugins/connection/lxc.py pylint:blacklisted-name plugins/connection/lxc.py pylint:blacklisted-name
plugins/module_utils/compat/ipaddress.py no-assert plugins/module_utils/compat/ipaddress.py no-assert
plugins/module_utils/compat/ipaddress.py no-unicode-literals plugins/module_utils/compat/ipaddress.py no-unicode-literals
plugins/modules/cloud/atomic/atomic_container.py validate-modules:doc-missing-type
plugins/modules/cloud/atomic/atomic_container.py validate-modules:no-default-for-required-parameter
plugins/modules/cloud/atomic/atomic_container.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/atomic/atomic_host.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/atomic/atomic_image.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/centurylink/clc_aa_policy.py validate-modules:doc-missing-type plugins/modules/cloud/centurylink/clc_aa_policy.py validate-modules:doc-missing-type
plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:doc-missing-type plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:doc-missing-type
plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:no-default-for-required-parameter plugins/modules/cloud/centurylink/clc_alert_policy.py validate-modules:no-default-for-required-parameter