From 080ae28e7ddb7ccb188ff88fd1ca680b18757d81 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Thu, 18 Feb 2021 19:21:52 +0300 Subject: [PATCH 1/9] azure-pipelines: update default container version --- .azure-pipelines/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 8ad8b8d..6eba847 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -36,7 +36,7 @@ variables: resources: containers: - container: default - image: quay.io/ansible/azure-pipelines-test-container:1.7.1 + image: quay.io/ansible/azure-pipelines-test-container:1.8.0 pool: Standard From a8594c547738d3b67bc32b62aa49e2f47a9cb348 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Mon, 1 Mar 2021 16:47:09 +0100 Subject: [PATCH 2/9] Remove tests/sanity/requirements.txt --- tests/sanity/requirements.txt | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tests/sanity/requirements.txt diff --git a/tests/sanity/requirements.txt b/tests/sanity/requirements.txt deleted file mode 100644 index 3e3a966..0000000 --- a/tests/sanity/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -packaging # needed for update-bundled and changelog -sphinx ; python_version >= '3.5' # docs build requires python 3+ -sphinx-notfound-page ; python_version >= '3.5' # docs build requires python 3+ -straight.plugin ; python_version >= '3.5' # needed for hacking/build-ansible.py which will host changelog generation and requires python 3+ From bbba9beb70438b9f6d2cec40b711222b5de944a2 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Tue, 2 Mar 2021 11:20:44 +0100 Subject: [PATCH 3/9] Add tests/sanity/ignore-2.11.txt --- tests/sanity/ignore-2.11.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/sanity/ignore-2.11.txt diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt new file mode 100644 index 0000000..f86017d --- /dev/null +++ b/tests/sanity/ignore-2.11.txt @@ -0,0 +1,33 @@ +plugins/module_utils/firewalld.py future-import-boilerplate +plugins/module_utils/firewalld.py metaclass-boilerplate +plugins/module_utils/mount.py future-import-boilerplate +plugins/module_utils/mount.py metaclass-boilerplate +plugins/modules/acl.py validate-modules:parameter-type-not-in-doc +plugins/modules/synchronize.py pylint:blacklisted-name +plugins/modules/synchronize.py use-argspec-type-path +plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec +plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented +plugins/modules/synchronize.py validate-modules:parameter-list-no-elements +plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc +plugins/modules/synchronize.py validate-modules:undocumented-parameter +plugins/modules/at.py validate-modules:doc-required-mismatch +plugins/modules/authorized_key.py validate-modules:parameter-type-not-in-doc +plugins/modules/seboolean.py validate-modules:parameter-type-not-in-doc +plugins/modules/selinux.py validate-modules:invalid-ansiblemodule-schema +plugins/modules/selinux.py validate-modules:parameter-type-not-in-doc +plugins/modules/sysctl.py validate-modules:doc-missing-type +plugins/modules/sysctl.py validate-modules:parameter-type-not-in-doc +tests/unit/mock/path.py future-import-boilerplate +tests/unit/mock/path.py metaclass-boilerplate +tests/unit/mock/yaml_helper.py future-import-boilerplate +tests/unit/mock/yaml_helper.py metaclass-boilerplate +tests/unit/modules/conftest.py future-import-boilerplate +tests/unit/modules/conftest.py metaclass-boilerplate +tests/unit/modules/system/test_mount.py future-import-boilerplate +tests/unit/modules/system/test_mount.py metaclass-boilerplate +tests/unit/modules/utils.py future-import-boilerplate +tests/unit/modules/utils.py metaclass-boilerplate +tests/unit/plugins/action/test_synchronize.py future-import-boilerplate +tests/unit/plugins/action/test_synchronize.py metaclass-boilerplate +tests/utils/shippable/check_matrix.py replace-urlopen +tests/utils/shippable/timing.py shebang From 2655a6ffc194bb63e902624c19ab41e6c22763ed Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Tue, 2 Mar 2021 11:47:07 +0100 Subject: [PATCH 4/9] remove changelogs/fragments/.empty --- changelogs/fragments/.empty | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 changelogs/fragments/.empty diff --git a/changelogs/fragments/.empty b/changelogs/fragments/.empty deleted file mode 100644 index e69de29..0000000 From 5b66052067532476f8748826019418810dd0b446 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Tue, 2 Mar 2021 11:55:38 +0100 Subject: [PATCH 5/9] remove upper bound (2.11) from meta/runtime.yml --- meta/runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/runtime.yml b/meta/runtime.yml index b8961b1..43bbe45 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,2 +1,2 @@ --- -requires_ansible: '>=2.9,<2.11' +requires_ansible: '>=2.9' From 04f976d7d35b665c865b2e7d9e465954316eab85 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 15 Feb 2021 16:14:20 +0530 Subject: [PATCH 6/9] Update OS as per guidelines Signed-off-by: Abhijeet Kasurde --- .azure-pipelines/azure-pipelines.yml | 30 +++++++++++++++------------- tests/utils/shippable/macos.sh | 1 + 2 files changed, 17 insertions(+), 14 deletions(-) create mode 120000 tests/utils/shippable/macos.sh diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 8ad8b8d..a51b162 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -57,18 +57,18 @@ stages: test: centos7 - name: CentOS 8 test: centos8 - - name: Fedora 30 - test: fedora30 - - name: Fedora 31 - test: fedora31 + - name: Fedora 32 + test: fedora32 + - name: Fedora 33 + test: fedora33 - name: openSUSE 15 py2 test: opensuse15py2 - name: openSUSE 15 py3 test: opensuse15 - - name: Ubuntu 16.04 - test: ubuntu1604 - name: Ubuntu 18.04 test: ubuntu1804 + - name: Ubuntu 20.04 + test: ubuntu2004 - stage: Docker_2_10 displayName: Docker 2.10 dependsOn: [] @@ -131,14 +131,16 @@ stages: parameters: testFormat: devel/{0}/1 targets: - - name: OS X 10.11 - test: osx/10.11 - - name: RHEL 7.6 - test: rhel/7.6 - - name: RHEL 8.1 - test: rhel/8.1 - - name: FreeBSD 11.1 - test: freebsd/11.1 + - name: MacOS 11.1 + test: macos/11.1 + - name: RHEL 7.9 + test: rhel/7.9 + - name: RHEL 8.3 + test: rhel/8.3 + - name: FreeBSD 11.4 + test: freebsd/11.4 + - name: FreeBSD 12.2 + test: freebsd/12.2 - name: FreeBSD 12.1 test: freebsd/12.1 - stage: Remote_2_10 diff --git a/tests/utils/shippable/macos.sh b/tests/utils/shippable/macos.sh new file mode 120000 index 0000000..6ddb776 --- /dev/null +++ b/tests/utils/shippable/macos.sh @@ -0,0 +1 @@ +remote.sh \ No newline at end of file From ea8fc7037317412db4653034c601472dae2618c5 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 15 Feb 2021 13:21:13 +0530 Subject: [PATCH 7/9] Fix sanity test for modules Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/misc_fix.yml | 2 ++ plugins/module_utils/firewalld.py | 4 +++ plugins/module_utils/mount.py | 4 +++ plugins/modules/acl.py | 6 +++++ plugins/modules/at.py | 4 +-- plugins/modules/authorized_key.py | 1 + plugins/modules/seboolean.py | 3 ++- plugins/modules/selinux.py | 7 ++++-- plugins/modules/synchronize.py | 7 ++++-- plugins/modules/sysctl.py | 11 +++++--- .../targets/selinux/tasks/selinux.yml | 14 ++++++++--- tests/sanity/ignore-2.10.txt | 25 ------------------- tests/sanity/ignore-2.11.txt | 25 ------------------- tests/sanity/ignore-2.9.txt | 22 ---------------- tests/unit/mock/path.py | 4 +++ tests/unit/mock/yaml_helper.py | 4 +++ tests/unit/modules/conftest.py | 4 +++ tests/unit/modules/system/test_mount.py | 4 +++ tests/unit/modules/utils.py | 4 +++ tests/unit/plugins/action/test_synchronize.py | 4 +++ 20 files changed, 73 insertions(+), 86 deletions(-) create mode 100644 changelogs/fragments/misc_fix.yml diff --git a/changelogs/fragments/misc_fix.yml b/changelogs/fragments/misc_fix.yml new file mode 100644 index 0000000..66b7eff --- /dev/null +++ b/changelogs/fragments/misc_fix.yml @@ -0,0 +1,2 @@ +minor_changes: +- fix sanity test for various modules. diff --git a/plugins/module_utils/firewalld.py b/plugins/module_utils/firewalld.py index b44e031..7c34db4 100644 --- a/plugins/module_utils/firewalld.py +++ b/plugins/module_utils/firewalld.py @@ -3,6 +3,10 @@ # (c) 2013-2018, Adam Miller (maxamillion@fedoraproject.org) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + # Imports and info for sanity checking from distutils.version import LooseVersion diff --git a/plugins/module_utils/mount.py b/plugins/module_utils/mount.py index 62feb35..58be0e8 100644 --- a/plugins/module_utils/mount.py +++ b/plugins/module_utils/mount.py @@ -48,6 +48,10 @@ # agrees to be bound by the terms and conditions of this License # Agreement. +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + import os diff --git a/plugins/modules/acl.py b/plugins/modules/acl.py index 38ff294..9e89157 100644 --- a/plugins/modules/acl.py +++ b/plugins/modules/acl.py @@ -28,6 +28,7 @@ options: - The C(query) state gets the current ACL without changing it, for use in C(register) operations. choices: [ absent, present, query ] default: query + type: str follow: description: - Whether to follow symlinks on the path if a symlink is encountered. @@ -42,13 +43,16 @@ options: entity: description: - The actual user or group that the ACL applies to when matching entity types user or group are selected. + type: str etype: description: - The entity type of the ACL to apply, see C(setfacl) documentation for more info. choices: [ group, mask, other, user ] + type: str permissions: description: - The permissions to apply/remove can be any combination of C(r), C(w) and C(x) (read, write and execute respectively) + type: str entry: description: - DEPRECATED. @@ -57,6 +61,7 @@ options: - The qualifier may be empty for some types, but the type and perms are always required. - C(-) can be used as placeholder when you do not care about permissions. - This is now superseded by entity, type and permissions fields. + type: str recursive: description: - Recursively sets the specified ACL. @@ -75,6 +80,7 @@ options: - Incompatible with C(state=query). choices: [ default, mask, no_mask ] default: default + type: str author: - Brian Coca (@bcoca) - Jérémie Astori (@astorije) diff --git a/plugins/modules/at.py b/plugins/modules/at.py index 4cbe0c7..b29b35e 100644 --- a/plugins/modules/at.py +++ b/plugins/modules/at.py @@ -8,7 +8,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' +DOCUMENTATION = r''' --- module: at short_description: Schedule the execution of a command or script file via the at command @@ -29,12 +29,10 @@ options: description: - The count of units in the future to execute the command or script file. type: int - required: true units: description: - The type of units in the future to execute the command or script file. type: str - required: true choices: [ minutes, hours, days, weeks ] state: description: diff --git a/plugins/modules/authorized_key.py b/plugins/modules/authorized_key.py index 5f7b4b7..d860822 100644 --- a/plugins/modules/authorized_key.py +++ b/plugins/modules/authorized_key.py @@ -50,6 +50,7 @@ options: key_options: description: - A string of ssh key options to be prepended to the key in the authorized_keys file. + type: str exclusive: description: - Whether to remove all other non-specified keys from the authorized_keys file. diff --git a/plugins/modules/seboolean.py b/plugins/modules/seboolean.py index 57889e9..ef1b8c6 100644 --- a/plugins/modules/seboolean.py +++ b/plugins/modules/seboolean.py @@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' +DOCUMENTATION = r''' --- module: seboolean short_description: Toggles SELinux booleans @@ -19,6 +19,7 @@ options: description: - Name of the boolean to configure. required: true + type: str persistent: description: - Set to C(yes) if the boolean setting should survive a reboot. diff --git a/plugins/modules/selinux.py b/plugins/modules/selinux.py index e32892d..a22c282 100644 --- a/plugins/modules/selinux.py +++ b/plugins/modules/selinux.py @@ -20,17 +20,20 @@ version_added: "1.0.0" options: policy: description: - - The name of the SELinux policy to use (e.g. C(targeted)) will be required if state is not C(disabled). + - The name of the SELinux policy to use (e.g. C(targeted)) will be required if I(state) is not C(disabled). + type: str state: description: - The SELinux mode. required: true choices: [ disabled, enforcing, permissive ] + type: str configfile: description: - The path to the SELinux configuration file, if non-standard. default: /etc/selinux/config aliases: [ conf, file ] + type: str requirements: [ libselinux-python ] author: - Derek Carter (@goozbach) @@ -178,7 +181,7 @@ def main(): module = AnsibleModule( argument_spec=dict( policy=dict(type='str'), - state=dict(type='str', required='True', choices=['enforcing', 'permissive', 'disabled']), + state=dict(type='str', required=True, choices=['enforcing', 'permissive', 'disabled']), configfile=dict(type='str', default='/etc/selinux/config', aliases=['conf', 'file']), ), supports_check_mode=True, diff --git a/plugins/modules/synchronize.py b/plugins/modules/synchronize.py index 6702cc3..8713a77 100644 --- a/plugins/modules/synchronize.py +++ b/plugins/modules/synchronize.py @@ -147,6 +147,7 @@ options: - Note that an empty string in C(rsync_opts) will end up transfer the current working directory. type: list default: + elements: str partial: description: - Tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster. @@ -166,6 +167,8 @@ options: - Add a destination to hard link against during the rsync. type: list default: + elements: str + notes: - rsync must be installed on both the local and remote host. - For the C(synchronize) module, the "local host" is the host `the synchronize task originates on`, and the "destination host" is the host @@ -390,12 +393,12 @@ def main(): group=dict(type='bool'), set_remote_user=dict(type='bool', default=True), rsync_timeout=dict(type='int', default=0), - rsync_opts=dict(type='list', default=[]), + rsync_opts=dict(type='list', default=[], elements='str'), ssh_args=dict(type='str'), partial=dict(type='bool', default=False), verify_host=dict(type='bool', default=False), mode=dict(type='str', default='push', choices=['pull', 'push']), - link_dest=dict(type='list') + link_dest=dict(type='list', elements='str'), ), supports_check_mode=True, ) diff --git a/plugins/modules/sysctl.py b/plugins/modules/sysctl.py index 1654ec6..b82b2e4 100644 --- a/plugins/modules/sysctl.py +++ b/plugins/modules/sysctl.py @@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' +DOCUMENTATION = r''' --- module: sysctl short_description: Manage entries in sysctl.conf. @@ -19,18 +19,21 @@ version_added: "1.0.0" options: name: description: - - The dot-separated path (aka I(key)) specifying the sysctl variable. + - The dot-separated path (also known as I(key)) specifying the sysctl variable. required: true aliases: [ 'key' ] + type: str value: description: - Desired value of the sysctl key. aliases: [ 'val' ] + type: str state: description: - Whether the entry should be present or absent in the sysctl file. choices: [ "present", "absent" ] default: present + type: str ignoreerrors: description: - Use this option to ignore errors about unknown keys. @@ -47,12 +50,14 @@ options: description: - Specifies the absolute path to C(sysctl.conf), if not C(/etc/sysctl.conf). default: /etc/sysctl.conf + type: path sysctl_set: description: - Verify token value with the sysctl command and set with -w if necessary type: bool default: 'no' -author: "David CHANIAL (@davixx) " +author: +- David CHANIAL (@davixx) ''' EXAMPLES = r''' diff --git a/tests/integration/targets/selinux/tasks/selinux.yml b/tests/integration/targets/selinux/tasks/selinux.yml index 6771f32..a262f8b 100644 --- a/tests/integration/targets/selinux/tasks/selinux.yml +++ b/tests/integration/targets/selinux/tasks/selinux.yml @@ -48,9 +48,17 @@ var: _disable_test1 verbosity: 1 +- name: Before gathering the fact + debug: + msg: "{{ ansible_selinux }}" + - name: TEST 1 | Re-gather facts setup: +- name: After gathering the fact + debug: + msg: "{{ ansible_selinux }}" + - name: TEST 1 | Assert that status was changed, reboot_required is True, a warning was displayed, and SELinux is configured properly assert: that: @@ -74,7 +82,7 @@ var: _disable_test2 verbosity: 1 -- name: TEST 1 | Assert that no change is reported, a warnking was dispalyed, and reboot_required is True +- name: TEST 1 | Assert that no change is reported, a warning was displayed, and reboot_required is True assert: that: - _disable_test2 is not changed @@ -147,7 +155,7 @@ var: _state_test2 verbosity: 1 -- name: TEST 2 | Assert that no change was reported, no warnings were dispalyed, and reboot_required is False +- name: TEST 2 | Assert that no change was reported, no warnings were displayed, and reboot_required is False assert: that: - _state_test2 is not changed @@ -380,7 +388,7 @@ var: _lineinfile_out1 verbosity: 1 -- name: TEST 5 | Set SELinux to enforcing +- name: TEST 5 | Set SELinux to enforcing selinux: state: enforcing policy: targeted diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index f86017d..013403f 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1,33 +1,8 @@ -plugins/module_utils/firewalld.py future-import-boilerplate -plugins/module_utils/firewalld.py metaclass-boilerplate -plugins/module_utils/mount.py future-import-boilerplate -plugins/module_utils/mount.py metaclass-boilerplate -plugins/modules/acl.py validate-modules:parameter-type-not-in-doc plugins/modules/synchronize.py pylint:blacklisted-name plugins/modules/synchronize.py use-argspec-type-path plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented -plugins/modules/synchronize.py validate-modules:parameter-list-no-elements plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc plugins/modules/synchronize.py validate-modules:undocumented-parameter -plugins/modules/at.py validate-modules:doc-required-mismatch -plugins/modules/authorized_key.py validate-modules:parameter-type-not-in-doc -plugins/modules/seboolean.py validate-modules:parameter-type-not-in-doc -plugins/modules/selinux.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/selinux.py validate-modules:parameter-type-not-in-doc -plugins/modules/sysctl.py validate-modules:doc-missing-type -plugins/modules/sysctl.py validate-modules:parameter-type-not-in-doc -tests/unit/mock/path.py future-import-boilerplate -tests/unit/mock/path.py metaclass-boilerplate -tests/unit/mock/yaml_helper.py future-import-boilerplate -tests/unit/mock/yaml_helper.py metaclass-boilerplate -tests/unit/modules/conftest.py future-import-boilerplate -tests/unit/modules/conftest.py metaclass-boilerplate -tests/unit/modules/system/test_mount.py future-import-boilerplate -tests/unit/modules/system/test_mount.py metaclass-boilerplate -tests/unit/modules/utils.py future-import-boilerplate -tests/unit/modules/utils.py metaclass-boilerplate -tests/unit/plugins/action/test_synchronize.py future-import-boilerplate -tests/unit/plugins/action/test_synchronize.py metaclass-boilerplate tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index f86017d..013403f 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,33 +1,8 @@ -plugins/module_utils/firewalld.py future-import-boilerplate -plugins/module_utils/firewalld.py metaclass-boilerplate -plugins/module_utils/mount.py future-import-boilerplate -plugins/module_utils/mount.py metaclass-boilerplate -plugins/modules/acl.py validate-modules:parameter-type-not-in-doc plugins/modules/synchronize.py pylint:blacklisted-name plugins/modules/synchronize.py use-argspec-type-path plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented -plugins/modules/synchronize.py validate-modules:parameter-list-no-elements plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc plugins/modules/synchronize.py validate-modules:undocumented-parameter -plugins/modules/at.py validate-modules:doc-required-mismatch -plugins/modules/authorized_key.py validate-modules:parameter-type-not-in-doc -plugins/modules/seboolean.py validate-modules:parameter-type-not-in-doc -plugins/modules/selinux.py validate-modules:invalid-ansiblemodule-schema -plugins/modules/selinux.py validate-modules:parameter-type-not-in-doc -plugins/modules/sysctl.py validate-modules:doc-missing-type -plugins/modules/sysctl.py validate-modules:parameter-type-not-in-doc -tests/unit/mock/path.py future-import-boilerplate -tests/unit/mock/path.py metaclass-boilerplate -tests/unit/mock/yaml_helper.py future-import-boilerplate -tests/unit/mock/yaml_helper.py metaclass-boilerplate -tests/unit/modules/conftest.py future-import-boilerplate -tests/unit/modules/conftest.py metaclass-boilerplate -tests/unit/modules/system/test_mount.py future-import-boilerplate -tests/unit/modules/system/test_mount.py metaclass-boilerplate -tests/unit/modules/utils.py future-import-boilerplate -tests/unit/modules/utils.py metaclass-boilerplate -tests/unit/plugins/action/test_synchronize.py future-import-boilerplate -tests/unit/plugins/action/test_synchronize.py metaclass-boilerplate tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index eba078e..013403f 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,30 +1,8 @@ -plugins/module_utils/firewalld.py future-import-boilerplate -plugins/module_utils/firewalld.py metaclass-boilerplate -plugins/module_utils/mount.py future-import-boilerplate -plugins/module_utils/mount.py metaclass-boilerplate -plugins/modules/acl.py validate-modules:parameter-type-not-in-doc plugins/modules/synchronize.py pylint:blacklisted-name plugins/modules/synchronize.py use-argspec-type-path plugins/modules/synchronize.py validate-modules:doc-default-does-not-match-spec plugins/modules/synchronize.py validate-modules:nonexistent-parameter-documented plugins/modules/synchronize.py validate-modules:parameter-type-not-in-doc plugins/modules/synchronize.py validate-modules:undocumented-parameter -plugins/modules/authorized_key.py validate-modules:parameter-type-not-in-doc -plugins/modules/seboolean.py validate-modules:parameter-type-not-in-doc -plugins/modules/selinux.py validate-modules:parameter-type-not-in-doc -plugins/modules/sysctl.py validate-modules:doc-missing-type -plugins/modules/sysctl.py validate-modules:parameter-type-not-in-doc -tests/unit/mock/path.py future-import-boilerplate -tests/unit/mock/path.py metaclass-boilerplate -tests/unit/mock/yaml_helper.py future-import-boilerplate -tests/unit/mock/yaml_helper.py metaclass-boilerplate -tests/unit/modules/conftest.py future-import-boilerplate -tests/unit/modules/conftest.py metaclass-boilerplate -tests/unit/modules/system/test_mount.py future-import-boilerplate -tests/unit/modules/system/test_mount.py metaclass-boilerplate -tests/unit/modules/utils.py future-import-boilerplate -tests/unit/modules/utils.py metaclass-boilerplate -tests/unit/plugins/action/test_synchronize.py future-import-boilerplate -tests/unit/plugins/action/test_synchronize.py metaclass-boilerplate tests/utils/shippable/check_matrix.py replace-urlopen tests/utils/shippable/timing.py shebang diff --git a/tests/unit/mock/path.py b/tests/unit/mock/path.py index d128b5f..1553008 100644 --- a/tests/unit/mock/path.py +++ b/tests/unit/mock/path.py @@ -1,3 +1,7 @@ +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + from ansible_collections.ansible.posix.tests.unit.compat.mock import MagicMock from ansible.utils.path import unfrackpath diff --git a/tests/unit/mock/yaml_helper.py b/tests/unit/mock/yaml_helper.py index cc095fe..a4c2d6d 100644 --- a/tests/unit/mock/yaml_helper.py +++ b/tests/unit/mock/yaml_helper.py @@ -1,3 +1,7 @@ +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + import io import yaml diff --git a/tests/unit/modules/conftest.py b/tests/unit/modules/conftest.py index 3bbfe0b..6eb5883 100644 --- a/tests/unit/modules/conftest.py +++ b/tests/unit/modules/conftest.py @@ -1,6 +1,10 @@ # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + import json import pytest diff --git a/tests/unit/modules/system/test_mount.py b/tests/unit/modules/system/test_mount.py index 893a651..73086cc 100644 --- a/tests/unit/modules/system/test_mount.py +++ b/tests/unit/modules/system/test_mount.py @@ -1,3 +1,7 @@ +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + import os import tempfile diff --git a/tests/unit/modules/utils.py b/tests/unit/modules/utils.py index 322a472..342d528 100644 --- a/tests/unit/modules/utils.py +++ b/tests/unit/modules/utils.py @@ -1,3 +1,7 @@ +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + import json from ansible_collections.ansible.posix.tests.unit.compat import unittest diff --git a/tests/unit/plugins/action/test_synchronize.py b/tests/unit/plugins/action/test_synchronize.py index f8f5f8a..39d9697 100644 --- a/tests/unit/plugins/action/test_synchronize.py +++ b/tests/unit/plugins/action/test_synchronize.py @@ -1,3 +1,7 @@ +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + ''' (Epdb) pprint(DeepDiff(self.final_task_vars, out_task_vars), indent=2) { 'dic_item_added': set([u"root['ansible_python_interpreter']"]), From 360d0c3441dae35ad6699bd6e4f245f139bdb88d Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Fri, 5 Mar 2021 13:53:38 +0100 Subject: [PATCH 8/9] Update azure-pipelines.yml and README.md --- .azure-pipelines/azure-pipelines.yml | 2 -- README.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index ec0ea8f..ab7c4ba 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -141,8 +141,6 @@ stages: test: freebsd/11.4 - name: FreeBSD 12.2 test: freebsd/12.2 - - name: FreeBSD 12.1 - test: freebsd/12.1 - stage: Remote_2_10 displayName: Remote 2.10 dependsOn: [] diff --git a/README.md b/README.md index 19359cd..73d8a05 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and de ## Ansible version compatibility -This collection has been tested against following Ansible versions: **>=2.9,<2.11**. +This collection has been tested against following Ansible versions: **>=2.9**. Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. From 4825036c7e3cd90372b8d31a2cd76dcf02e2f801 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Fri, 5 Mar 2021 14:25:22 +0100 Subject: [PATCH 9/9] Update AZP aggregate-coverage.sh and report-coverage.sh --- .azure-pipelines/scripts/aggregate-coverage.sh | 7 ++++++- .azure-pipelines/scripts/report-coverage.sh | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/scripts/aggregate-coverage.sh b/.azure-pipelines/scripts/aggregate-coverage.sh index 2200502..f3113dd 100755 --- a/.azure-pipelines/scripts/aggregate-coverage.sh +++ b/.azure-pipelines/scripts/aggregate-coverage.sh @@ -12,4 +12,9 @@ mkdir "${agent_temp_directory}/coverage/" options=(--venv --venv-system-site-packages --color -v) ansible-test coverage combine --export "${agent_temp_directory}/coverage/" "${options[@]}" -ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}" + +if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then + # Only analyze coverage if the installed version of ansible-test supports it. + # Doing so allows this script to work unmodified for multiple Ansible versions. + ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}" +fi diff --git a/.azure-pipelines/scripts/report-coverage.sh b/.azure-pipelines/scripts/report-coverage.sh index f154998..1bd91bd 100755 --- a/.azure-pipelines/scripts/report-coverage.sh +++ b/.azure-pipelines/scripts/report-coverage.sh @@ -5,6 +5,11 @@ set -o pipefail -eu PATH="${PWD}/bin:${PATH}" -pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check +if ! ansible-test --help >/dev/null 2>&1; then + # Install the devel version of ansible-test for generating code coverage reports. + # This is only used by Ansible Collections, which are typically tested against multiple Ansible versions (in separate jobs). + # Since a version of ansible-test is required that can work the output from multiple older releases, the devel version is used. + pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check +fi ansible-test coverage xml --stub --venv --venv-system-site-packages --color -v