From 0e71c0e53090ca6894687a30b37921aeb313f809 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Fri, 1 Apr 2022 12:22:20 +0900 Subject: [PATCH] Fixed documentation and options to address new sanity tests - https://docs.ansible.com/ansible/latest/dev_guide/testing_validate-modules.html Signed-off-by: Hideki Saito --- README.md | 10 +++++----- changelogs/fragments/349_follow_new_guidelines.yml | 3 +++ meta/runtime.yml | 6 ++++++ plugins/callback/cgroup_perf_recap.py | 4 ++-- plugins/callback/debug.py | 2 +- plugins/callback/json.py | 2 +- plugins/callback/profile_roles.py | 2 +- plugins/callback/profile_tasks.py | 2 +- plugins/callback/skippy.py | 12 ++++++------ plugins/callback/timer.py | 4 ++-- plugins/modules/mount.py | 8 ++++---- plugins/shell/csh.py | 9 ++++----- plugins/shell/fish.py | 9 ++++----- 13 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 changelogs/fragments/349_follow_new_guidelines.yml diff --git a/README.md b/README.md index 9542c96..33511ce 100644 --- a/README.md +++ b/README.md @@ -86,12 +86,12 @@ None -* ansible-core 2.14 (devel) +- ansible-core 2.14 (devel) - ansible-core 2.13 (stable) -* ansible-core 2.12 (stable) -* ansible-core 2.11 (stable) -* ansible-base 2.10 (stable) -* ansible 2.9 (stable) +- ansible-core 2.12 (stable) +- ansible-core 2.11 (stable) +- ansible-base 2.10 (stable) +- ansible 2.9 (stable) ## Roadmap diff --git a/changelogs/fragments/349_follow_new_guidelines.yml b/changelogs/fragments/349_follow_new_guidelines.yml new file mode 100644 index 0000000..2b13e12 --- /dev/null +++ b/changelogs/fragments/349_follow_new_guidelines.yml @@ -0,0 +1,3 @@ +--- +trivial: +- CI tests - following the new sanity check guideline (https://github.com/ansible-collections/ansible.posix/issues/348). diff --git a/meta/runtime.yml b/meta/runtime.yml index 43bbe45..f43de48 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,2 +1,8 @@ --- requires_ansible: '>=2.9' +plugin_routing: + callback: + skippy: + deprecation: + removal_date: '2022-06-01' + warning_text: See the plugin documentation for more details diff --git a/plugins/callback/cgroup_perf_recap.py b/plugins/callback/cgroup_perf_recap.py index 5313353..d1f4247 100644 --- a/plugins/callback/cgroup_perf_recap.py +++ b/plugins/callback/cgroup_perf_recap.py @@ -11,8 +11,8 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', 'supported_by': 'community'} DOCUMENTATION = ''' - callback: cgroup_perf_recap - callback_type: aggregate + name: cgroup_perf_recap + type: aggregate requirements: - whitelist in configuration - cgroups diff --git a/plugins/callback/debug.py b/plugins/callback/debug.py index a7e1d15..85e0f4e 100644 --- a/plugins/callback/debug.py +++ b/plugins/callback/debug.py @@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: debug + name: debug type: stdout short_description: formatted stdout/stderr display description: diff --git a/plugins/callback/json.py b/plugins/callback/json.py index a69f38f..f0c56b4 100644 --- a/plugins/callback/json.py +++ b/plugins/callback/json.py @@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: json + name: json short_description: Ansible screen output as JSON description: - This callback converts all events into JSON output to stdout diff --git a/plugins/callback/profile_roles.py b/plugins/callback/profile_roles.py index fc0346e..13dae0c 100644 --- a/plugins/callback/profile_roles.py +++ b/plugins/callback/profile_roles.py @@ -7,7 +7,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: profile_roles + name: profile_roles type: aggregate short_description: adds timing information to roles description: diff --git a/plugins/callback/profile_tasks.py b/plugins/callback/profile_tasks.py index e4b5e91..c6118df 100644 --- a/plugins/callback/profile_tasks.py +++ b/plugins/callback/profile_tasks.py @@ -10,7 +10,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: profile_tasks + name: profile_tasks type: aggregate short_description: adds time information to tasks description: diff --git a/plugins/callback/skippy.py b/plugins/callback/skippy.py index 9c12ee4..ced28af 100644 --- a/plugins/callback/skippy.py +++ b/plugins/callback/skippy.py @@ -7,19 +7,19 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: skippy - callback_type: stdout + name: skippy + type: stdout requirements: - set as main display callback short_description: Ansible screen output that ignores skipped status deprecated: - why: The 'default' callback plugin now supports this functionality - removed_at_date: 2022-06-01 - alternative: "'default' callback plugin with 'display_skipped_hosts = no' option" + why: The 'default' callback plugin now supports this functionality + removed_at_date: '2022-06-01' + alternative: "'default' callback plugin with 'display_skipped_hosts = no' option" extends_documentation_fragment: - default_callback description: - - This callback does the same as the default except it does not output skipped host/task/item status + - This callback does the same as the default except it does not output skipped host/task/item status ''' from ansible.plugins.callback.default import CallbackModule as CallbackModule_default diff --git a/plugins/callback/timer.py b/plugins/callback/timer.py index 7b38d10..3ef9255 100644 --- a/plugins/callback/timer.py +++ b/plugins/callback/timer.py @@ -6,8 +6,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' - callback: timer - callback_type: aggregate + name: timer + type: aggregate requirements: - whitelist in configuration short_description: Adds time to play stats diff --git a/plugins/modules/mount.py b/plugins/modules/mount.py index 8b28f12..2021464 100644 --- a/plugins/modules/mount.py +++ b/plugins/modules/mount.py @@ -50,7 +50,7 @@ options: with subsequent runs. - Has no effect on Solaris systems. type: str - default: 0 + default: '0' passno: description: - Passno (see fstab(5)). @@ -59,7 +59,7 @@ options: with subsequent runs. - Deprecated on Solaris systems. type: str - default: 0 + default: '0' state: description: - If C(mounted), the device will be actively mounted and appropriately @@ -667,12 +667,12 @@ def main(): module = AnsibleModule( argument_spec=dict( boot=dict(type='bool', default=True), - dump=dict(type='str'), + dump=dict(type='str', default='0'), fstab=dict(type='str'), fstype=dict(type='str'), path=dict(type='path', required=True, aliases=['name']), opts=dict(type='str'), - passno=dict(type='str', no_log=False), + passno=dict(type='str', no_log=False, default='0'), src=dict(type='path'), backup=dict(type='bool', default=False), state=dict(type='str', required=True, choices=['absent', 'mounted', 'present', 'unmounted', 'remounted']), diff --git a/plugins/shell/csh.py b/plugins/shell/csh.py index bce5734..9baae25 100644 --- a/plugins/shell/csh.py +++ b/plugins/shell/csh.py @@ -4,13 +4,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible.module_utils.six import text_type -from ansible.module_utils.six.moves import shlex_quote -from ansible.plugins.shell import ShellBase - DOCUMENTATION = ''' name: csh - plugin_type: shell short_description: C shell (/bin/csh) description: - When you have no other option than to use csh @@ -18,6 +13,10 @@ DOCUMENTATION = ''' - shell_common ''' +from ansible.module_utils.six import text_type +from ansible.module_utils.six.moves import shlex_quote +from ansible.plugins.shell import ShellBase + class ShellModule(ShellBase): diff --git a/plugins/shell/fish.py b/plugins/shell/fish.py index ea13358..b96efa5 100644 --- a/plugins/shell/fish.py +++ b/plugins/shell/fish.py @@ -4,13 +4,8 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible.module_utils.six import text_type -from ansible.module_utils.six.moves import shlex_quote -from ansible.plugins.shell.sh import ShellModule as ShModule - DOCUMENTATION = ''' name: fish - plugin_type: shell short_description: fish shell (/bin/fish) description: - This is here because some people are restricted to fish. @@ -18,6 +13,10 @@ DOCUMENTATION = ''' - shell_common ''' +from ansible.module_utils.six import text_type +from ansible.module_utils.six.moves import shlex_quote +from ansible.plugins.shell.sh import ShellModule as ShModule + class ShellModule(ShModule):