From b991f4f9afb86142376242d54236f2452870f16d Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Fri, 1 Nov 2024 16:58:48 +0900 Subject: [PATCH 01/29] Update README to cover RH guidelines * Fixes #585 Signed-off-by: Hideki Saito --- README.md | 104 ++++++++++++--------- changelogs/fragments/587_update_README.yml | 3 + 2 files changed, 62 insertions(+), 45 deletions(-) create mode 100644 changelogs/fragments/587_update_README.yml diff --git a/README.md b/README.md index ddbbb1b..31c3e21 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ https://dev.azure.com/ansible/ansible.posix/_apis/build/status/CI?branchName=main)](https://dev.azure.com/ansible/ansible.posix/_build?definitionId=26) [![Run Status](https://api.shippable.com/projects/5e669aaf8b17a60007e4d18d/badge?branch=main)]() - -An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and derivative Operating Systems. - ## Communication * Join the Ansible forum: @@ -14,65 +11,72 @@ An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and de * [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts. * [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events. -* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes. +## Description -For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html). + +An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and derivative Operating Systems. -## Supported Versions of Ansible - -## Ansible version compatibility +## Requirements -This collection has been tested against following Ansible versions: **>=2.15**. - +* Python: + * The Python interpreter version must meet Ansible Core's requirements. +* Ansible Core: + - ansible-core 2.15 or later -## Included content -Check out [Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/ansible/posix/content/) or [the Ansible documentation](https://docs.ansible.com/ansible/devel/collections/ansible/posix/) for all modules and plugins included in this collection. +## Installation -## Installing this collection +Before using this collection, you need to install it with the Ansible Galaxy command-line tool: -You can install the ``ansible.posix`` collection with the Ansible Galaxy CLI: +```shell +ansible-galaxy collection install ansible.posix +``` - ansible-galaxy collection install ansible.posix +You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format: -You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format: ```yaml ---- collections: - name: ansible.posix ``` -## Using this collection +Note that if you install any collections from Ansible Galaxy, they will not be upgraded automatically when you upgrade the Ansible package. +To upgrade the collection to the latest available version, run the following command: - +```shell +ansible-galaxy collection install ansible.posix --upgrade +``` -See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details. +You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version 1.0.0: -## Contributing to this collection +```shell +ansible-galaxy collection install ansible.posix:==1.0.0 +``` - +See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. -We welcome community contributions to this collection. See [Contributing to Ansible-maintained collections](https://docs.ansible.com/ansible/devel/community/contributing_maintained_collections.html#contributing-maintained-collections) for complete details. +* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes. -* [Issues](https://github.com/ansible-collections/ansible.posix/issues) -* [Pull Requests](https://github.com/ansible-collections/ansible.posix/pulls) -* [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) +For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html). -### Code of Conduct -This collection follows the Ansible project's -[Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html). -Please read and familiarize yourself with this document. +## Use Cases -## Release notes -See [changelog](https://github.com/ansible-collections/ansible.posix/blob/main/CHANGELOG.rst) for more details. +You can see the general use-cases as an example by `ansible-doc` command like below. -## External requirements +For example, ansible.posix.firewalld module: +```shell +ansible-doc ansible.posix.firewalld +``` -None +Also, if you want to confirm the plugins descriptions, you can follow the following option with `ansible-doc` command: -## Tested with Ansible +For example, ansible.posix.profile_tasks callback plugin: +```shell +ansible-doc -t callback ansible.posix.profile_tasks +``` - +## Testing + +The following ansible-core versions have been tested with this collection: - ansible-core 2.19 (devel) - ansible-core 2.18 (stable) * @@ -82,20 +86,30 @@ None *Note: For ansible-core 2.18, CI only covers sanity tests and no integration tests will be run until the test environment is released.* -## Roadmap +## Contributing - +We welcome community contributions to this collection. For more details, see [Contributing to Ansible-maintained collections](https://docs.ansible.com/ansible/devel/community/contributing_maintained_collections.html#contributing-maintained-collections) for complete details. -## More information +* [Issues](https://github.com/ansible-collections/ansible.posix/issues) +* [Pull Requests](https://github.com/ansible-collections/ansible.posix/pulls) +* [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) - -- [Ansible Collection overview](https://github.com/ansible-collections/overview) -- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html) -- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html) -- [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) +## Support -## Licensing +See [Communication](#Communication) section. + +## Release Notes and Roadmap + +See [changelog](https://github.com/ansible-collections/ansible.posix/blob/main/CHANGELOG.rst) for more details. + +## Related Information + +This document was written using the following [template](https://access.redhat.com/articles/7068606). + +The README has been carefully prepared to cover the [community template](https://github.com/ansible-collections/collection_template/blob/main/README.md), but if you find any problems, please file a [documentation issue](https://github.com/ansible-collections/ansible.posix/issues/new?assignees=&labels=&projects=&template=documentation_report.md). + +## License Information GNU General Public License v3.0 or later. diff --git a/changelogs/fragments/587_update_README.yml b/changelogs/fragments/587_update_README.yml new file mode 100644 index 0000000..c2c3c72 --- /dev/null +++ b/changelogs/fragments/587_update_README.yml @@ -0,0 +1,3 @@ +--- +trivial: + - README.md - update README to cover RH guidelines (https://github.com/ansible-collections/ansible.posix/issues/585). From 04283b5993f57f5713e1bdb0fb57f246cda62365 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Wed, 6 Nov 2024 11:07:13 +0900 Subject: [PATCH 02/29] [CI] enable integration tests for devel branch * Remote tests * Docker tests Signed-off-by: Hideki Saito --- .azure-pipelines/azure-pipelines.yml | 4 ++-- README.md | 2 -- changelogs/fragments/588_ci_enable_devel.yml | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/588_ci_enable_devel.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 7c7ec26..f19332a 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -279,7 +279,7 @@ stages: - Remote_2_18 - Docker_2_18 - Sanity_devel - # - Remote_devel # Wait for test environment release - # - Docker_devel # Wait for test environment release + - Remote_devel + - Docker_devel jobs: - template: templates/coverage.yml diff --git a/README.md b/README.md index 31c3e21..5e333f1 100644 --- a/README.md +++ b/README.md @@ -84,8 +84,6 @@ The following ansible-core versions have been tested with this collection: - ansible-core 2.16 (stable) - ansible-core 2.15 (stable) -*Note: For ansible-core 2.18, CI only covers sanity tests and no integration tests will be run until the test environment is released.* - ## Contributing We welcome community contributions to this collection. For more details, see [Contributing to Ansible-maintained collections](https://docs.ansible.com/ansible/devel/community/contributing_maintained_collections.html#contributing-maintained-collections) for complete details. diff --git a/changelogs/fragments/588_ci_enable_devel.yml b/changelogs/fragments/588_ci_enable_devel.yml new file mode 100644 index 0000000..22d50e4 --- /dev/null +++ b/changelogs/fragments/588_ci_enable_devel.yml @@ -0,0 +1,3 @@ +--- +trivial: + - Enabled remote and docker integration tests for devel branch. From ae95adcfdc594970d5ea47846ef7b0cda51ca70b Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Thu, 14 Nov 2024 14:07:27 +0900 Subject: [PATCH 03/29] Replace FreeBSD 13.3 with 13.4 and add FreeBSD 14.1 for devel It's for integration test environments for ansible-core devel. Signed-off-by: Hideki Saito --- .azure-pipelines/azure-pipelines.yml | 6 ++++-- changelogs/fragments/593_replace_freebsd_version.yml | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/593_replace_freebsd_version.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index f19332a..255f89a 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -203,8 +203,10 @@ stages: targets: - name: RHEL 9.4 test: rhel/9.4 - - name: FreeBSD 13.3 - test: freebsd/13.3 + - name: FreeBSD 14.1 + test: freebsd/14.1 + - name: FreeBSD 13.4 + test: freebsd/13.4 - stage: Remote_2_18 displayName: Remote devel dependsOn: [] diff --git a/changelogs/fragments/593_replace_freebsd_version.yml b/changelogs/fragments/593_replace_freebsd_version.yml new file mode 100644 index 0000000..0b445fd --- /dev/null +++ b/changelogs/fragments/593_replace_freebsd_version.yml @@ -0,0 +1,3 @@ +--- +trivial: + - Replaced FreeBSD version 13.3 with 13.4 and 14.1 in CI for devel branch. From 8e34860d6ccda0cd9ebb5a86e2ba365e4b94767d Mon Sep 17 00:00:00 2001 From: Vladimir Botka Date: Thu, 21 Nov 2024 20:54:27 +0100 Subject: [PATCH 04/29] Fix #595. Remove comment from fstab entry on updating. --- plugins/modules/mount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/mount.py b/plugins/modules/mount.py index dadbd46..b9e496e 100644 --- a/plugins/modules/mount.py +++ b/plugins/modules/mount.py @@ -303,7 +303,7 @@ def _set_mount_save_old(module, args): continue - fields = line.split() + fields = line.split('#')[0].split() # Check if we got a valid line for splitting # (on Linux the 5th and the 6th field is optional) From 6175a5028b1f02ab113b9c195a5a0a7b47d8f2ff Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Thu, 28 Nov 2024 13:59:52 +0900 Subject: [PATCH 05/29] Change type of icmp_block_inversion option from str to bool * Fixes #586 Signed-off-by: Hideki Saito --- .../fragments/598_icmp_block_inversion.yml | 3 + plugins/modules/firewalld.py | 58 ++++++++++--------- .../tasks/icmp_block_inversion_test_cases.yml | 57 ------------------ 3 files changed, 33 insertions(+), 85 deletions(-) create mode 100644 changelogs/fragments/598_icmp_block_inversion.yml diff --git a/changelogs/fragments/598_icmp_block_inversion.yml b/changelogs/fragments/598_icmp_block_inversion.yml new file mode 100644 index 0000000..0daaf8f --- /dev/null +++ b/changelogs/fragments/598_icmp_block_inversion.yml @@ -0,0 +1,3 @@ +--- +breaking_changes: + - firewalld - Changed the type of icmp_block_inversion option from str to bool (https://github.com/ansible-collections/ansible.posix/issues/586). diff --git a/plugins/modules/firewalld.py b/plugins/modules/firewalld.py index 4333afd..6dd26aa 100644 --- a/plugins/modules/firewalld.py +++ b/plugins/modules/firewalld.py @@ -74,7 +74,8 @@ options: icmp_block_inversion: description: - Enable/Disable inversion of ICMP blocks for a zone in firewalld. - type: str + - Note that the option type is changed to bool in ansible.posix version 2.0.0 and later. + type: bool zone: description: - The firewalld zone to add/remove to/from. @@ -152,7 +153,7 @@ author: ''' EXAMPLES = r''' -- name: permanently enable https service, also enable it immediately if possible +- name: Permanently enable https service, also enable it immediately if possible ansible.posix.firewalld: service: https state: enabled @@ -160,81 +161,92 @@ EXAMPLES = r''' immediate: true offline: true -- name: permit traffic in default zone for https service +- name: Permit traffic in default zone for https service ansible.posix.firewalld: service: https permanent: true state: enabled -- name: permit ospf traffic +- name: Permit ospf traffic ansible.posix.firewalld: protocol: ospf permanent: true state: enabled -- name: do not permit traffic in default zone on port 8081/tcp +- name: Do not permit traffic in default zone on port 8081/tcp ansible.posix.firewalld: port: 8081/tcp permanent: true state: disabled -- ansible.posix.firewalld: +- name: Permit traffic in default zone on port 161-162/ucp + ansible.posix.firewalld: port: 161-162/udp permanent: true state: enabled -- ansible.posix.firewalld: +- name: Permit traffic in dmz zone on http service + ansible.posix.firewalld: zone: dmz service: http permanent: true state: enabled -- ansible.posix.firewalld: +- name: Enable FTP service with rate limiting using firewalld rich rule + ansible.posix.firewalld: rich_rule: rule service name="ftp" audit limit value="1/m" accept permanent: true state: enabled -- ansible.posix.firewalld: +- name: Allow traffic from 192.0.2.0/24 in internal zone + ansible.posix.firewalld: source: 192.0.2.0/24 zone: internal state: enabled -- ansible.posix.firewalld: +- name: Assign eth2 interface to trusted zone + ansible.posix.firewalld: zone: trusted interface: eth2 permanent: true state: enabled -- ansible.posix.firewalld: +- name: Enable forwarding in internal zone + ansible.posix.firewalld: forward: true state: enabled permanent: true zone: internal -- ansible.posix.firewalld: +- name: Enable masquerade in dmz zone + ansible.posix.firewalld: masquerade: true state: enabled permanent: true zone: dmz -- ansible.posix.firewalld: +- name: Create custom zone if not already present + ansible.posix.firewalld: zone: custom state: present permanent: true -- ansible.posix.firewalld: +- name: Enable ICMP block inversion in drop zone + ansible.posix.firewalld: zone: drop state: enabled permanent: true icmp_block_inversion: true -- ansible.posix.firewalld: +- name: Block ICMP echo requests in drop zone + ansible.posix.firewalld: zone: drop state: enabled permanent: true icmp_block: echo-request -- ansible.posix.firewalld: +- name: Set internal zone target to ACCEPT + ansible.posix.firewalld: zone: internal state: present permanent: true @@ -250,7 +262,6 @@ EXAMPLES = r''' ''' from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.parsing.convert_bool import boolean from ansible_collections.ansible.posix.plugins.module_utils.firewalld import FirewallTransaction, fw_offline try: @@ -864,7 +875,7 @@ def main(): module = AnsibleModule( argument_spec=dict( icmp_block=dict(type='str'), - icmp_block_inversion=dict(type='str'), + icmp_block_inversion=dict(type='bool'), service=dict(type='str'), protocol=dict(type='str'), port=dict(type='str'), @@ -987,16 +998,7 @@ def main(): msgs.append("Changed icmp-block %s to %s" % (icmp_block, desired_state)) if icmp_block_inversion is not None: - # Type of icmp_block_inversion will be changed to boolean in a future release. - icmp_block_inversion_status = True - try: - icmp_block_inversion_status = boolean(icmp_block_inversion, True) - except TypeError: - module.warn('The value of the icmp_block_inversion option is "%s". ' - 'The type of the option will be changed from string to boolean in a future release. ' - 'To avoid unexpected behavior, please change the value to boolean.' % icmp_block_inversion) - expected_state = 'enabled' if (desired_state == 'enabled') == icmp_block_inversion_status else 'disabled' - + expected_state = 'enabled' if (desired_state == 'enabled') == icmp_block_inversion else 'disabled' transaction = IcmpBlockInversionTransaction( module, action_args=(), diff --git a/tests/integration/targets/firewalld/tasks/icmp_block_inversion_test_cases.yml b/tests/integration/targets/firewalld/tasks/icmp_block_inversion_test_cases.yml index 3bd5bf0..f416c85 100644 --- a/tests/integration/targets/firewalld/tasks/icmp_block_inversion_test_cases.yml +++ b/tests/integration/targets/firewalld/tasks/icmp_block_inversion_test_cases.yml @@ -114,60 +114,3 @@ ansible.builtin.assert: that: - result is not changed - -# Validate backwards compatible behavior until icmp block inversion is switched from string to boolean type -- name: Icmp block inversion enabled when icmp block inversion is non-boolean string and state is enabled - block: - - name: Testing enable icmp block inversion - ansible.posix.firewalld: - zone: trusted - icmp_block_inversion: some string - permanent: true - state: enabled - register: result - - - name: Assert icmp block inversion is enabled - ansible.builtin.assert: - that: - - result is changed - - - name: Testing enable icmp block inversion (verify not changed) - ansible.posix.firewalld: - zone: trusted - icmp_block_inversion: some string - permanent: true - state: enabled - register: result - - - name: Assert icmp block inversion is enabled (verify not changed) - ansible.builtin.assert: - that: - - result is not changed - -- name: Icmp block inversion disabled when icmp block inversion is non-boolean string and state is disabled - block: - - name: Testing disable icmp block inversion - ansible.posix.firewalld: - zone: trusted - icmp_block_inversion: some string - permanent: true - state: disabled - register: result - - - name: Assert icmp block inversion is disabled - ansible.builtin.assert: - that: - - result is changed - - - name: Testing disable icmp block inversion (verify not changed) - ansible.posix.firewalld: - zone: trusted - icmp_block_inversion: some string - permanent: true - state: disabled - register: result - - - name: Assert icmp block inversion is disabled (verify not changed) - ansible.builtin.assert: - that: - - result is not changed From 7b8d627552291a228ef9d6b6d8da469556970475 Mon Sep 17 00:00:00 2001 From: Vladimir Botka Date: Thu, 28 Nov 2024 08:17:41 +0100 Subject: [PATCH 06/29] Changelog fragment added. --- changelogs/fragments/597_remove_fstab_comment_on_updating.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/597_remove_fstab_comment_on_updating.yml diff --git a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml new file mode 100644 index 0000000..30d98d7 --- /dev/null +++ b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - fstab - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). From 91129ed38107e807bb7c269a158b77c3f1d231e4 Mon Sep 17 00:00:00 2001 From: Vladimir Botka Date: Fri, 29 Nov 2024 03:34:14 +0100 Subject: [PATCH 07/29] Fix changelog fragment module name. --- changelogs/fragments/597_remove_fstab_comment_on_updating.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml index 30d98d7..c1c51a9 100644 --- a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml +++ b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml @@ -1,3 +1,3 @@ --- bugfixes: - - fstab - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). + - mount - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). From f5eae121464bc9051618e9fb6d3882444e4c84c0 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Wed, 4 Dec 2024 09:46:44 +0900 Subject: [PATCH 08/29] Release 2.0.0 commit Signed-off-by: Hideki Saito --- CHANGELOG.rst | 68 +++++++++++++++ changelogs/changelog.yaml | 85 +++++++++++++++++++ changelogs/fragments/365-boot-linux.yml | 3 - .../fragments/387_callback_output_header.yml | 3 - changelogs/fragments/566_bump_version_161.yml | 3 - .../fragments/567_remove_version_added.yml | 3 - .../fragments/568_update_authorized_key.yml | 3 - changelogs/fragments/570_nfs4_acl.yml | 3 - .../fragments/571_ci_bump_core_version.yml | 3 - changelogs/fragments/576_bump_version_2.yml | 3 - changelogs/fragments/581_ci_selinux.yml | 3 - .../fragments/584_firewalld_opt_type.yml | 3 - changelogs/fragments/587_update_README.yml | 3 - changelogs/fragments/588_ci_enable_devel.yml | 3 - .../fragments/593_replace_freebsd_version.yml | 3 - .../597_remove_fstab_comment_on_updating.yml | 3 - .../fragments/598_icmp_block_inversion.yml | 3 - 17 files changed, 153 insertions(+), 45 deletions(-) delete mode 100644 changelogs/fragments/365-boot-linux.yml delete mode 100644 changelogs/fragments/387_callback_output_header.yml delete mode 100644 changelogs/fragments/566_bump_version_161.yml delete mode 100644 changelogs/fragments/567_remove_version_added.yml delete mode 100644 changelogs/fragments/568_update_authorized_key.yml delete mode 100644 changelogs/fragments/570_nfs4_acl.yml delete mode 100644 changelogs/fragments/571_ci_bump_core_version.yml delete mode 100644 changelogs/fragments/576_bump_version_2.yml delete mode 100644 changelogs/fragments/581_ci_selinux.yml delete mode 100644 changelogs/fragments/584_firewalld_opt_type.yml delete mode 100644 changelogs/fragments/587_update_README.yml delete mode 100644 changelogs/fragments/588_ci_enable_devel.yml delete mode 100644 changelogs/fragments/593_replace_freebsd_version.yml delete mode 100644 changelogs/fragments/597_remove_fstab_comment_on_updating.yml delete mode 100644 changelogs/fragments/598_icmp_block_inversion.yml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8a844cc..75def47 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,74 @@ ansible.posix Release Notes .. contents:: Topics +v2.0.0 +====== + +Release Summary +--------------- + +This is the major release of the ``ansible.posix`` collection. +This changelog contains all changes to the modules and plugins +in this collection that have been added after the release of +``ansible.posix`` 1.6.2 + +Minor Changes +------------- + +- authorized_keys - allow using absolute path to a file as a SSH key(s) source (https://github.com/ansible-collections/ansible.posix/pull/568) +- callback plugins - Add recap information to timer, profile_roles and profile_tasks callback outputs (https://github.com/ansible-collections/ansible.posix/pull/387). + +Breaking Changes / Porting Guide +-------------------------------- + +- firewalld - Changed the type of forward and masquerade options from str to bool (https://github.com/ansible-collections/ansible.posix/issues/582). +- firewalld - Changed the type of icmp_block_inversion option from str to bool (https://github.com/ansible-collections/ansible.posix/issues/586). + +Removed Features (previously deprecated) +---------------------------------------- + +- skippy - Remove skippy pluglin as it is no longer supported(https://github.com/ansible-collections/ansible.posix/issues/350). + +Bugfixes +-------- + +- acl - Fixed to set ACLs on paths mounted with NFS version 4 correctly (https://github.com/ansible-collections/ansible.posix/issues/240). +- mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364). +- mount - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). + +v1.6.2 +====== + +Release Summary +--------------- + +This is the bugfix release of the stable version ``ansible.posix`` collection. +This changelog contains all changes to the modules and plugins +in this collection that have been added after the release of +``ansible.posix`` 1.6.1. + +Bugfixes +-------- + +- backport - Drop ansible-core 2.14 and set 2.15 minimum version (https://github.com/ansible-collections/ansible.posix/issues/578). + +v1.6.1 +====== + +Release Summary +--------------- + +This is the bugfix release of the stable version ``ansible.posix`` collection. +This changelog contains all changes to the modules and plugins +in this collection that have been added after the release of +``ansible.posix`` 1.6.1. + +Bugfixes +-------- + +- acl - Fixed to set ACLs on paths mounted with NFS version 4 correctly (https://github.com/ansible-collections/ansible.posix/issues/240). +- mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364). +- skippy - Revert removal of skippy plugin. It will be removed in version 2.0.0 (https://github.com/ansible-collections/ansible.posix/issues/573). v1.6.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 70ee8c8..2fbc83f 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -405,3 +405,88 @@ releases: - dropping-ansible29.yml - test-reqs.yml release_date: '2024-09-11' + 1.6.1: + changes: + bugfixes: + - acl - Fixed to set ACLs on paths mounted with NFS version 4 correctly (https://github.com/ansible-collections/ansible.posix/issues/240). + - mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364). + - skippy - Revert removal of skippy plugin. It will be removed in version 2.0.0 + (https://github.com/ansible-collections/ansible.posix/issues/573). + release_summary: 'This is the bugfix release of the stable version ``ansible.posix`` + collection. + + This changelog contains all changes to the modules and plugins + + in this collection that have been added after the release of + + ``ansible.posix`` 1.6.1.' + fragments: + - 1.6.1.yml + - 365-boot-linux.yml + - 566_bump_version_161.yml + - 567_remove_version_added.yml + - 570_nfs4_acl.yml + - 571_ci_bump_core_version.yml + - 572_revert_removal_of_skippy.yml + release_date: '2024-10-11' + 1.6.2: + changes: + bugfixes: + - backport - Drop ansible-core 2.14 and set 2.15 minimum version (https://github.com/ansible-collections/ansible.posix/issues/578). + release_summary: 'This is the bugfix release of the stable version ``ansible.posix`` + collection. + + This changelog contains all changes to the modules and plugins + + in this collection that have been added after the release of + + ``ansible.posix`` 1.6.1.' + fragments: + - 1.6.2.yml + - 580_drop_ansible214.yml + release_date: '2024-10-22' + 2.0.0: + changes: + breaking_changes: + - firewalld - Changed the type of forward and masquerade options from str to + bool (https://github.com/ansible-collections/ansible.posix/issues/582). + - firewalld - Changed the type of icmp_block_inversion option from str to bool + (https://github.com/ansible-collections/ansible.posix/issues/586). + bugfixes: + - acl - Fixed to set ACLs on paths mounted with NFS version 4 correctly (https://github.com/ansible-collections/ansible.posix/issues/240). + - mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364). + - mount - If a comment is appended to a fstab entry, state present creates a + double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). + minor_changes: + - authorized_keys - allow using absolute path to a file as a SSH key(s) source + (https://github.com/ansible-collections/ansible.posix/pull/568) + - callback plugins - Add recap information to timer, profile_roles and profile_tasks + callback outputs (https://github.com/ansible-collections/ansible.posix/pull/387). + release_summary: 'This is the major release of the ``ansible.posix`` collection. + + This changelog contains all changes to the modules and plugins + + in this collection that have been added after the release of + + ``ansible.posix`` 1.6.2' + removed_features: + - skippy - Remove skippy pluglin as it is no longer supported(https://github.com/ansible-collections/ansible.posix/issues/350). + fragments: + - 2.0.0.yml + - 365-boot-linux.yml + - 387_callback_output_header.yml + - 556_remove_skippy_callback.yml + - 566_bump_version_161.yml + - 567_remove_version_added.yml + - 568_update_authorized_key.yml + - 570_nfs4_acl.yml + - 571_ci_bump_core_version.yml + - 576_bump_version_2.yml + - 581_ci_selinux.yml + - 584_firewalld_opt_type.yml + - 587_update_README.yml + - 588_ci_enable_devel.yml + - 593_replace_freebsd_version.yml + - 597_remove_fstab_comment_on_updating.yml + - 598_icmp_block_inversion.yml + release_date: '2024-12-04' diff --git a/changelogs/fragments/365-boot-linux.yml b/changelogs/fragments/365-boot-linux.yml deleted file mode 100644 index ec88776..0000000 --- a/changelogs/fragments/365-boot-linux.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -bugfixes: - - mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364). diff --git a/changelogs/fragments/387_callback_output_header.yml b/changelogs/fragments/387_callback_output_header.yml deleted file mode 100644 index 5eb8573..0000000 --- a/changelogs/fragments/387_callback_output_header.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -minor_changes: - - callback plugins - Add recap information to timer, profile_roles and profile_tasks callback outputs (https://github.com/ansible-collections/ansible.posix/pull/387). diff --git a/changelogs/fragments/566_bump_version_161.yml b/changelogs/fragments/566_bump_version_161.yml deleted file mode 100644 index 18bb513..0000000 --- a/changelogs/fragments/566_bump_version_161.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - Bump version to 1.6.1 for next release. diff --git a/changelogs/fragments/567_remove_version_added.yml b/changelogs/fragments/567_remove_version_added.yml deleted file mode 100644 index 12d0040..0000000 --- a/changelogs/fragments/567_remove_version_added.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - mount - remove wrong version_added section from ``opts_no_log``. diff --git a/changelogs/fragments/568_update_authorized_key.yml b/changelogs/fragments/568_update_authorized_key.yml deleted file mode 100644 index 7efa29c..0000000 --- a/changelogs/fragments/568_update_authorized_key.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -minor_changes: - - authorized_keys - allow using absolute path to a file as a SSH key(s) source (https://github.com/ansible-collections/ansible.posix/pull/568) diff --git a/changelogs/fragments/570_nfs4_acl.yml b/changelogs/fragments/570_nfs4_acl.yml deleted file mode 100644 index a6a7f69..0000000 --- a/changelogs/fragments/570_nfs4_acl.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -bugfixes: - - acl - Fixed to set ACLs on paths mounted with NFS version 4 correctly (https://github.com/ansible-collections/ansible.posix/issues/240). diff --git a/changelogs/fragments/571_ci_bump_core_version.yml b/changelogs/fragments/571_ci_bump_core_version.yml deleted file mode 100644 index bec2e29..0000000 --- a/changelogs/fragments/571_ci_bump_core_version.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - Bump ansible-core version to 2.19 of devel branch and add 2.18 to CI. diff --git a/changelogs/fragments/576_bump_version_2.yml b/changelogs/fragments/576_bump_version_2.yml deleted file mode 100644 index a93dbf6..0000000 --- a/changelogs/fragments/576_bump_version_2.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - Bump ansible.posix version to 2.0.0. diff --git a/changelogs/fragments/581_ci_selinux.yml b/changelogs/fragments/581_ci_selinux.yml deleted file mode 100644 index c38b2f2..0000000 --- a/changelogs/fragments/581_ci_selinux.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - selinux - conditions for selinux integration tests have been modified to be more accurate. diff --git a/changelogs/fragments/584_firewalld_opt_type.yml b/changelogs/fragments/584_firewalld_opt_type.yml deleted file mode 100644 index 44ede21..0000000 --- a/changelogs/fragments/584_firewalld_opt_type.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -breaking_changes: - - firewalld - Changed the type of forward and masquerade options from str to bool (https://github.com/ansible-collections/ansible.posix/issues/582). diff --git a/changelogs/fragments/587_update_README.yml b/changelogs/fragments/587_update_README.yml deleted file mode 100644 index c2c3c72..0000000 --- a/changelogs/fragments/587_update_README.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - README.md - update README to cover RH guidelines (https://github.com/ansible-collections/ansible.posix/issues/585). diff --git a/changelogs/fragments/588_ci_enable_devel.yml b/changelogs/fragments/588_ci_enable_devel.yml deleted file mode 100644 index 22d50e4..0000000 --- a/changelogs/fragments/588_ci_enable_devel.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - Enabled remote and docker integration tests for devel branch. diff --git a/changelogs/fragments/593_replace_freebsd_version.yml b/changelogs/fragments/593_replace_freebsd_version.yml deleted file mode 100644 index 0b445fd..0000000 --- a/changelogs/fragments/593_replace_freebsd_version.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -trivial: - - Replaced FreeBSD version 13.3 with 13.4 and 14.1 in CI for devel branch. diff --git a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml deleted file mode 100644 index c1c51a9..0000000 --- a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -bugfixes: - - mount - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). diff --git a/changelogs/fragments/598_icmp_block_inversion.yml b/changelogs/fragments/598_icmp_block_inversion.yml deleted file mode 100644 index 0daaf8f..0000000 --- a/changelogs/fragments/598_icmp_block_inversion.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -breaking_changes: - - firewalld - Changed the type of icmp_block_inversion option from str to bool (https://github.com/ansible-collections/ansible.posix/issues/586). From 83288b9020b66881892aab5e7e6b1c3e04f0c81b Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Tue, 10 Dec 2024 17:30:22 +0900 Subject: [PATCH 09/29] Bump version to 3.0.0 for the next release * Fixes #603 Signed-off-by: Hideki Saito --- changelogs/fragments/603_bump_version_3.yml | 2 ++ galaxy.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/603_bump_version_3.yml diff --git a/changelogs/fragments/603_bump_version_3.yml b/changelogs/fragments/603_bump_version_3.yml new file mode 100644 index 0000000..6794958 --- /dev/null +++ b/changelogs/fragments/603_bump_version_3.yml @@ -0,0 +1,2 @@ +trivial: + - Bump version to 3.0.0 for the next release (https://github.com/ansible-collections/ansible.posix/issues/603). diff --git a/galaxy.yml b/galaxy.yml index 01e619c..9a0b34d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: ansible name: posix -version: 2.0.0 +version: 3.0.0 readme: README.md authors: - Ansible (github.com/ansible) From eb740e97d4238d441fa33e8f8b2dfcdfd720d262 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 5 Mar 2025 00:33:11 +0000 Subject: [PATCH 10/29] add check mode tests, add comments --- .../integration/targets/mount/tasks/main.yml | 346 +++++++++++++++++- 1 file changed, 339 insertions(+), 7 deletions(-) diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index bb91648..49fa003 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -1,3 +1,4 @@ +# SETUP ################################################################################ - name: Install dependencies (Linux) ansible.builtin.package: name: e2fsprogs @@ -110,6 +111,46 @@ mode: '0644' register: orig_info +# BIND MOUNT ################################################################################ +# bind mount check mode +- name: Bind mount a filesystem (Linux) (check mode) + ansible.posix.mount: + src: '{{ output_dir }}/mount_source' + name: '{{ output_dir }}/mount_dest' + state: mounted + fstype: None + opts: bind + when: ansible_system == 'Linux' + register: bind_result_linux_dry_run + check_mode: true + +- name: Bind mount a filesystem (FreeBSD) (check mode) + ansible.posix.mount: + src: '{{ output_dir }}/mount_source' + name: '{{ output_dir }}/mount_dest' + state: mounted + fstype: nullfs + when: ansible_system == 'FreeBSD' + register: bind_result_freebsd_dry_run + check_mode: true + +- name: attempt to stat bind mounted file + ansible.builtin.stat: + path: '{{ output_dir }}/mount_dest/test_file' + when: ansible_system in ('FreeBSD', 'Linux') + register: dest_stat + +- name: Assert the bind mount did not take place + ansible.builtin.assert: + that: + - linux_and_changed or freebsd_and_changed + - not dest_stat['stat']['exists'] + vars: + linux_and_changed: "{{ ansible_system == 'Linux' and bind_result_linux_dry_run['changed'] }}" + freebsd_and_changed: "{{ ansible_system == 'FreeBSD' and bind_result_freebsd['changed'] }}" + when: ansible_system in ('FreeBSD', 'Linux') + +# bind mount - name: Bind mount a filesystem (Linux) ansible.posix.mount: src: '{{ output_dir }}/mount_source' @@ -168,6 +209,48 @@ - (ansible_system == 'Linux' and not bind_result_linux['changed']) or (ansible_system == 'FreeBSD' and not bind_result_freebsd['changed']) when: ansible_system in ('FreeBSD', 'Linux') +# remount check mode +- name: Remount filesystem with different opts (Linux) (check mode) + ansible.posix.mount: + src: '{{ output_dir }}/mount_source' + name: '{{ output_dir }}/mount_dest' + state: mounted + fstype: None + opts: bind,ro + when: ansible_system == 'Linux' + register: bind_result_linux + check_mode: true + +- name: Remount filesystem with different opts (FreeBSD) (check mode) + ansible.posix.mount: + src: '{{ output_dir }}/mount_source' + name: '{{ output_dir }}/mount_dest' + state: mounted + fstype: nullfs + opts: ro + when: ansible_system == 'FreeBSD' + register: bind_result_freebsd + check_mode: true + +- name: Get mount options + ansible.builtin.shell: + cmd: set -o pipefail && mount | grep mount_dest | grep -c -E -w '(ro|read-only)' + executable: "{{ shell_executable }}" + changed_when: false + failed_when: false + register: new_options_count + +- name: Make sure the filesystem does not have the new opts + ansible.builtin.assert: + that: + - linux_and_changed or freebsd_and_changed + - new_options_count.stdout | int == 0 + vars: + linux_and_changed: "{{ ansible_system == 'Linux' and bind_result_linux_dry_run['changed'] }}" + freebsd_and_changed: "{{ ansible_system == 'FreeBSD' and bind_result_freebsd['changed'] }}" + when: ansible_system in ('FreeBSD', 'Linux') + +# remount - name: Remount filesystem with different opts (Linux) ansible.posix.mount: src: '{{ output_dir }}/mount_source' @@ -203,6 +286,29 @@ - 1 == remount_options.stdout_lines | length when: ansible_system in ('FreeBSD', 'Linux') +# unmount check mode +- name: Unmount the bind mount (check mode) + ansible.posix.mount: + name: '{{ output_dir }}/mount_dest' + state: absent + when: ansible_system in ('Linux', 'FreeBSD') + register: unmount_result + check_mode: true + +- name: Make sure the file still exists in dest + ansible.builtin.stat: + path: '{{ output_dir }}/mount_dest/test_file' + when: ansible_system in ('FreeBSD', 'Linux') + register: dest_stat + +- name: Check that we did not unmount + ansible.builtin.assert: + that: + - unmount_result['changed'] + - dest_stat['stat']['exists'] + when: ansible_system in ('FreeBSD', 'Linux') + +# unmount - name: Unmount the bind mount ansible.posix.mount: name: '{{ output_dir }}/mount_dest' @@ -223,9 +329,36 @@ - not dest_stat['stat']['exists'] when: ansible_system in ('FreeBSD', 'Linux') -- name: Block to test remounted option +# SWAP ############################################################# +- name: swap when: ansible_system in ('Linux') block: + # mount swap check mode + - name: Stat /etc/fstab + stat: + path: /etc/fstab + register: stat_fstab_before + + - name: Create fstab record for the first swap file (check mode) + ansible.posix.mount: + name: none + src: /tmp/swap1 + opts: sw + fstype: swap + state: present + check_mode: true + + - name: Stat /etc/fstab + stat: + path: /etc/fstab + register: stat_fstab_after + + - name: Assert that fstab checksum did not change + ansible.builtin.assert: + that: + - stat_fstab_before.stat.checksum == stat_fstab_after.stat.checksum + + # mount swap1 - name: Create fstab record for the first swap file ansible.posix.mount: name: none @@ -250,6 +383,7 @@ - swap1_created['changed'] - not swap1_created_again['changed'] + # mount swap2 - name: Create fstab record for the second swap file ansible.posix.mount: name: none @@ -274,6 +408,30 @@ - swap2_created['changed'] - not swap2_created_again['changed'] + # remove swap check mode + - name: Stat /etc/fstab + stat: + path: /etc/fstab + register: stat_fstab_before + + - name: Remove the fstab record for the first swap file (check mode) + ansible.posix.mount: + name: none + src: /tmp/swap1 + state: absent + check_mode: true + + - name: Stat /etc/fstab + stat: + path: /etc/fstab + register: stat_fstab_after + + - name: Assert that fstab checksum did not change + ansible.builtin.assert: + that: + - stat_fstab_before.stat.checksum == stat_fstab_after.stat.checksum + + # remove swap1 - name: Remove the fstab record for the first swap file ansible.posix.mount: name: none @@ -294,6 +452,7 @@ - swap1_removed['changed'] - not swap1_removed_again['changed'] + # remove swap2 - name: Remove the fstab record for the second swap file ansible.posix.mount: name: none @@ -314,6 +473,10 @@ - swap2_removed['changed'] - not swap2_removed_again['changed'] +# FIXUP ############################################################# +- name: fix incomplete entry already present in fstab + when: ansible_system == 'Linux' + block: - name: Create fstab record with missing last two fields ansible.builtin.copy: dest: /etc/fstab @@ -343,6 +506,11 @@ - ''' 0 0'' in optional_fields_content.stdout' - 1 == optional_fields_content.stdout_lines | length +# REMOUNTED ############################################################# +- name: Block to test remounted option + when: ansible_system in ('Linux') + block: + # setup - name: Create empty file community.general.filesize: path: /tmp/myfs.img @@ -372,6 +540,26 @@ ansible.builtin.pause: seconds: 2 + # remount check mode + - name: Remount (check mode) + ansible.posix.mount: + path: /tmp/myfs + state: remounted + + - name: Get again the last write time + ansible.builtin.shell: + cmd: >- + set -o pipefail && dumpe2fs /tmp/myfs.img 2>/dev/null | grep -i "last write time:" |cut -d: -f2- + executable: "{{ shell_executable }}" + changed_when: false + register: last_write_time_check + + - name: Fail if they are different + ansible.builtin.fail: + msg: Filesytem was remounted, testing of the module failed! + when: last_write_time.stdout != last_write_time_check.stdout + + # remount - name: Test if the FS is remounted ansible.posix.mount: path: /tmp/myfs @@ -390,6 +578,28 @@ msg: Filesytem was not remounted, testing of the module failed! when: last_write is defined and last_write_time2 is defined and last_write_time.stdout == last_write_time2.stdout + # remount different options check mode + - name: Remount filesystem with different opts using remounted option (Linux only) + ansible.posix.mount: + path: /tmp/myfs + state: remounted + opts: rw,noexec + check_mode: true + + - name: Get remounted options (Linux only) + ansible.builtin.shell: + cmd: set -o pipefail && mount | grep myfs | grep -E -w 'noexec' | wc -l + executable: "{{ shell_executable }}" + changed_when: false + register: remounted_options + + - name: Make sure the filesystem now has the new opts after using remounted (Linux only) + ansible.builtin.assert: + that: + - "'0' in remounted_options.stdout" + - "1 == remounted_options.stdout_lines | length" + + # remount different options - name: Remount filesystem with different opts using remounted option (Linux only) ansible.posix.mount: path: /tmp/myfs @@ -409,6 +619,7 @@ - "'1' in remounted_options.stdout" - "1 == remounted_options.stdout_lines | length" + # backup - name: Mount the FS again to test backup ansible.posix.mount: path: /tmp/myfs @@ -439,9 +650,11 @@ - /tmp/myfs.img - /tmp/myfs +# BOOT ############################################################# - name: Block to test boot option for Linux when: ansible_system in ('Linux') block: + # setup - name: Create empty file community.general.filesize: path: /tmp/myfs.img @@ -452,6 +665,7 @@ fstype: ext3 dev: /tmp/myfs.img + # noauto - name: Mount the FS with noauto option ansible.posix.mount: path: /tmp/myfs @@ -472,6 +686,7 @@ path: /tmp/myfs state: absent + # noauto + defaults - name: Mount the FS with noauto option and defaults ansible.posix.mount: path: /tmp/myfs @@ -499,6 +714,7 @@ - /tmp/myfs.img - /tmp/myfs +# NEWLINE END OF FILE ############################################ - name: Block to test missing newline at the EOF of fstab when: ansible_system in ('Linux') block: @@ -537,6 +753,7 @@ - /tmp/myfs1 - /tmp/test_fstab +# EPHEMERAL ################################################ - name: Block to test ephemeral option environment: PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin @@ -552,8 +769,7 @@ path: /tmp/myfs_B.img size: 20M - ##### FORMAT FS ON LINUX - + ##### FORMAT FS ON LINUX - name: Block to format FS on Linux when: ansible_system == 'Linux' block: @@ -567,8 +783,7 @@ fstype: ext3 dev: /tmp/myfs_B.img - ##### FORMAT FS ON SOLARIS AND BSD - + ##### FORMAT FS ON SOLARIS AND BSD - name: Create loop devices on Solaris and BSD ansible.builtin.shell: cmd: "set -o pipefail && {{ ephemeral_create_loop_dev_cmd }}" @@ -583,14 +798,54 @@ changed_when: true when: ephemeral_format_fs_cmd is defined - ##### TESTS - - name: Create fstab if it does not exist ansible.builtin.file: path: "{{ ephemeral_fstab }}" state: touch mode: '0644' + # normal ephemeral mount check mode + - name: Get checksum of /etc/fstab before mounting anything + ansible.builtin.stat: + path: '{{ ephemeral_fstab }}' + register: fstab_stat_before_mount + + - name: Mount the FS A with ephemeral state + ansible.posix.mount: + path: /tmp/myfs + src: '{{ ephemeral_device_a }}' + fstype: '{{ ephemeral_fstype }}' + opts: rw + state: ephemeral + register: ephemeral_mount_info + + - name: Put something in the directory so we can do additional checks later on + ansible.builtin.copy: + content: 'Testing' + dest: /tmp/myfs/test_file + mode: '0644' + + - name: Get checksum of /etc/fstab after an ephemeral mount + ansible.builtin.stat: + path: '{{ ephemeral_fstab }}' + register: fstab_stat_after_mount + + - name: Get mountinfo + ansible.builtin.shell: + cmd: grep -c '/tmp/myfs' <(mount -v) + executable: "{{ shell_executable }}" + register: check_mountinfo + failed_when: false + changed_when: false + + - name: Assert the mount occured and the fstab is unchanged + ansible.builtin.assert: + that: + - check_mountinfo.stdout|int == 0 + - ephemeral_mount_info['changed'] + - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_mount['stat']['checksum'] + + # normal ephemeral mount - name: Get checksum of /etc/fstab before mounting anything ansible.builtin.stat: path: '{{ ephemeral_fstab }}' @@ -631,6 +886,48 @@ - ephemeral_mount_info['changed'] - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_mount['stat']['checksum'] + # remount different options check mode + - name: Get first mount record + ansible.builtin.shell: + cmd: grep '/tmp/myfs' <(mount -v) + executable: "{{ shell_executable }}" + register: ephemeral_mount_record_1 + changed_when: false + + - name: Try to mount FS A where FS A is already mounted (should trigger remount and changed) + ansible.posix.mount: + path: /tmp/myfs + src: '{{ ephemeral_device_a }}' + fstype: '{{ ephemeral_fstype }}' + opts: ro + state: ephemeral + register: ephemeral_mount_info + check_mode: true + + - name: Get second mount record (should be different than the first) + ansible.builtin.shell: + cmd: grep '/tmp/myfs' <(mount -v) + executable: "{{ shell_executable }}" + register: ephemeral_mount_record_2 + changed_when: false + + - name: Get mountinfo + ansible.builtin.shell: + cmd: grep -c '/tmp/myfs' <(mount -v) + executable: "{{ shell_executable }}" + failed_when: false + register: check_mountinfo + changed_when: false + + - name: Assert the FS A is still mounted, the options changed and the fstab unchanged + ansible.builtin.assert: + that: + - check_mountinfo.stdout|int == 0 + - ephemeral_mount_record_1.stdout != ephemeral_mount_record_2.stdout + - ephemeral_mount_info['changed'] + - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_mount['stat']['checksum'] + + # remount different options - name: Get first mount record ansible.builtin.shell: cmd: grep '/tmp/myfs' <(mount -v) @@ -670,6 +967,7 @@ - ephemeral_mount_info['changed'] - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_mount['stat']['checksum'] + # conflicting mount - name: Try to mount file B on file A mountpoint (should fail) ansible.posix.mount: path: /tmp/myfs @@ -707,6 +1005,39 @@ - test_file_stat['stat']['exists'] - ephemeral_mount_b_info is failed + # unmount check mode + - name: Unmount FS with state = unmounted + ansible.posix.mount: + path: /tmp/myfs + state: unmounted + check_mode: true + + - name: Get fstab checksum after unmounting an ephemeral mount with state = unmounted + ansible.builtin.stat: + path: '{{ ephemeral_fstab }}' + register: fstab_stat_after_unmount + + - name: Get mountinfo + ansible.builtin.shell: + cmd: grep -c '/tmp/myfs' <(mount -v) + executable: "{{ shell_executable }}" + register: check_mountinfo + failed_when: false + changed_when: false + + - name: Try to stat our test file + ansible.builtin.stat: + path: /tmp/myfs/test_file + register: test_file_stat + + - name: Assert that fstab is unchanged after unmounting an ephemeral mount with state = unmounted + ansible.builtin.assert: + that: + - check_mountinfo.stdout|int == 0 + - not test_file_stat['stat']['exists'] + - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_unmount['stat']['checksum'] + + # unmount - name: Unmount FS with state = unmounted ansible.posix.mount: path: /tmp/myfs @@ -759,6 +1090,7 @@ - /tmp/myfs_B.img - /tmp/myfs +# OPTS_NO_LOG ###################################### - name: Block to test opts_no_log option when: ansible_system == 'Linux' block: From f087d58cbe6fe9b9e831592e14dd4ffa3b3f1c3f Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 5 Mar 2025 00:39:46 +0000 Subject: [PATCH 11/29] fix bugs --- .../integration/targets/mount/tasks/main.yml | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index 49fa003..7aa65f5 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -590,6 +590,7 @@ ansible.builtin.shell: cmd: set -o pipefail && mount | grep myfs | grep -E -w 'noexec' | wc -l executable: "{{ shell_executable }}" + failed_when: false changed_when: false register: remounted_options @@ -818,12 +819,7 @@ opts: rw state: ephemeral register: ephemeral_mount_info - - - name: Put something in the directory so we can do additional checks later on - ansible.builtin.copy: - content: 'Testing' - dest: /tmp/myfs/test_file - mode: '0644' + check_mode: true - name: Get checksum of /etc/fstab after an ephemeral mount ansible.builtin.stat: @@ -919,11 +915,11 @@ register: check_mountinfo changed_when: false - - name: Assert the FS A is still mounted, the options changed and the fstab unchanged + - name: Assert the FS A is still mounted, the options unchanged and the fstab unchanged ansible.builtin.assert: that: - - check_mountinfo.stdout|int == 0 - - ephemeral_mount_record_1.stdout != ephemeral_mount_record_2.stdout + - check_mountinfo.stdout|int == 1 + - ephemeral_mount_record_1.stdout == ephemeral_mount_record_2.stdout - ephemeral_mount_info['changed'] - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_mount['stat']['checksum'] @@ -1030,11 +1026,11 @@ path: /tmp/myfs/test_file register: test_file_stat - - name: Assert that fstab is unchanged after unmounting an ephemeral mount with state = unmounted + - name: Assert that unmount did not take place and fstab unchanged ansible.builtin.assert: that: - - check_mountinfo.stdout|int == 0 - - not test_file_stat['stat']['exists'] + - check_mountinfo.stdout|int == 1 + - test_file_stat['stat']['exists'] - fstab_stat_before_mount['stat']['checksum'] == fstab_stat_after_unmount['stat']['checksum'] # unmount From 7d8da00f792649a3c7dd0dfc8664c315be6218fe Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Thu, 6 Mar 2025 10:46:57 -0500 Subject: [PATCH 12/29] add (check mode) to task name --- tests/integration/targets/mount/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index 7aa65f5..c35f31d 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -811,7 +811,7 @@ path: '{{ ephemeral_fstab }}' register: fstab_stat_before_mount - - name: Mount the FS A with ephemeral state + - name: Mount the FS A with ephemeral state (check mode) ansible.posix.mount: path: /tmp/myfs src: '{{ ephemeral_device_a }}' From d9f54eb9d488c91bf0ec72013c3510f762efbf24 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 26 Mar 2025 08:45:57 -0700 Subject: [PATCH 13/29] [CI] update test containers Signed-off-by: Abhijeet Kasurde --- .azure-pipelines/azure-pipelines.yml | 20 ++++++++++---------- tests/utils/shippable/shippable.sh | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 255f89a..78781bd 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -122,14 +122,14 @@ stages: parameters: testFormat: devel/linux/{0}/1 targets: - - name: Fedora 40 - test: fedora40 + - name: Fedora 41 + test: fedora41 - name: Ubuntu 22.04 test: ubuntu2204 - name: Ubuntu 24.04 test: ubuntu2404 - stage: Docker_2_18 - displayName: Docker devel + displayName: Docker 2.18 dependsOn: [] jobs: - template: templates/matrix.yml @@ -201,14 +201,14 @@ stages: parameters: testFormat: devel/{0}/1 targets: - - name: RHEL 9.4 - test: rhel/9.4 - - name: FreeBSD 14.1 - test: freebsd/14.1 - - name: FreeBSD 13.4 - test: freebsd/13.4 + - name: RHEL 9.5 + test: rhel/9.5 + - name: FreeBSD 14.2 + test: freebsd/14.2 + - name: FreeBSD 13.5 + test: freebsd/13.5 - stage: Remote_2_18 - displayName: Remote devel + displayName: Remote 2.18 dependsOn: [] jobs: - template: templates/matrix.yml diff --git a/tests/utils/shippable/shippable.sh b/tests/utils/shippable/shippable.sh index 6269f57..44beb23 100755 --- a/tests/utils/shippable/shippable.sh +++ b/tests/utils/shippable/shippable.sh @@ -62,15 +62,15 @@ else retry pip install "https://github.com/ansible/ansible/archive/stable-${ansible_version}.tar.gz" --disable-pip-version-check fi -export ANSIBLE_COLLECTIONS_PATHS="${PWD}/../../../" +export ANSIBLE_COLLECTIONS_PATH="${PWD}/../../../" # START: HACK install dependencies if [ "${ansible_version}" == "2.9" ] || [ "${ansible_version}" == "2.10" ]; then # Note: Since community.general 5.x, Ansible Core versions prior to 2.11 are not supported. # So we need to use 4.8.1 for Ansible 2.9 and Ansible Engine 2.10. - retry git clone --depth=1 --single-branch -b 4.8.1 https://github.com/ansible-collections/community.general.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/general" + retry git clone --depth=1 --single-branch -b 4.8.1 https://github.com/ansible-collections/community.general.git "${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/community/general" else - retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.general.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/general" + retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.general.git "${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/community/general" fi # Note: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) # END: HACK From 979f00ce757095fccb49364ef2606396894fab9b Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 26 Mar 2025 15:18:35 -0400 Subject: [PATCH 14/29] fix lint errors --- tests/integration/targets/mount/tasks/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index c35f31d..bc903b8 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -134,7 +134,7 @@ register: bind_result_freebsd_dry_run check_mode: true -- name: attempt to stat bind mounted file +- name: Attempt to stat bind mounted file ansible.builtin.stat: path: '{{ output_dir }}/mount_dest/test_file' when: ansible_system in ('FreeBSD', 'Linux') @@ -330,12 +330,12 @@ when: ansible_system in ('FreeBSD', 'Linux') # SWAP ############################################################# -- name: swap +- name: Swap when: ansible_system in ('Linux') block: # mount swap check mode - name: Stat /etc/fstab - stat: + ansible.builtin.stat: path: /etc/fstab register: stat_fstab_before @@ -349,7 +349,7 @@ check_mode: true - name: Stat /etc/fstab - stat: + ansible.builtin.stat: path: /etc/fstab register: stat_fstab_after @@ -410,7 +410,7 @@ # remove swap check mode - name: Stat /etc/fstab - stat: + ansible.builtin.stat: path: /etc/fstab register: stat_fstab_before @@ -422,7 +422,7 @@ check_mode: true - name: Stat /etc/fstab - stat: + ansible.builtin.stat: path: /etc/fstab register: stat_fstab_after @@ -474,7 +474,7 @@ - not swap2_removed_again['changed'] # FIXUP ############################################################# -- name: fix incomplete entry already present in fstab +- name: Fix incomplete entry already present in fstab when: ansible_system == 'Linux' block: - name: Create fstab record with missing last two fields From 4ff0e3aa139118c912b77053323489d9202142f4 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Wed, 26 Mar 2025 15:20:42 -0400 Subject: [PATCH 15/29] remove assertion of changed --- tests/integration/targets/mount/tasks/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index bc903b8..c3bca6c 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -143,11 +143,7 @@ - name: Assert the bind mount did not take place ansible.builtin.assert: that: - - linux_and_changed or freebsd_and_changed - not dest_stat['stat']['exists'] - vars: - linux_and_changed: "{{ ansible_system == 'Linux' and bind_result_linux_dry_run['changed'] }}" - freebsd_and_changed: "{{ ansible_system == 'FreeBSD' and bind_result_freebsd['changed'] }}" when: ansible_system in ('FreeBSD', 'Linux') # bind mount From eead50b287f3dc4ca05cb16525ed08a78717b897 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 26 Mar 2025 12:36:08 -0700 Subject: [PATCH 16/29] Apply suggestions from code review --- tests/integration/targets/mount/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index c3bca6c..d96f865 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -830,7 +830,7 @@ failed_when: false changed_when: false - - name: Assert the mount occured and the fstab is unchanged + - name: Assert the mount occurred and the fstab is unchanged ansible.builtin.assert: that: - check_mountinfo.stdout|int == 0 From 1b8aeb03cb09ed26fbdf6f9e7c0628efdb565efc Mon Sep 17 00:00:00 2001 From: Pavel Knoblokh Date: Thu, 27 Mar 2025 12:21:08 +1000 Subject: [PATCH 17/29] sysctl: Add custom sysctl file example (#606) --- plugins/modules/sysctl.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/modules/sysctl.py b/plugins/modules/sysctl.py index 3edcc72..86712db 100644 --- a/plugins/modules/sysctl.py +++ b/plugins/modules/sysctl.py @@ -80,6 +80,13 @@ EXAMPLES = r''' sysctl_file: /tmp/test_sysctl.conf reload: false +# Enable resource limits management in FreeBSD +- ansible.posix.sysctl: + name: kern.racct.enable + value: '1' + sysctl_file: /boot/loader.conf + reload: false + # Set ip forwarding on in /proc and verify token value with the sysctl command - ansible.posix.sysctl: name: net.ipv4.ip_forward From 2cec8cbed55f0683989893e70afae3a739e4f0bd Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Fri, 28 Mar 2025 09:52:17 +0900 Subject: [PATCH 18/29] [CI] Remove ubuntu20.04 from CI tests * Fixes #612 Signed-off-by: Hideki Saito --- .azure-pipelines/azure-pipelines.yml | 6 ------ changelogs/fragments/618_ci_remove_ubuntu2004.yml | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/618_ci_remove_ubuntu2004.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 78781bd..699e4ff 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -152,8 +152,6 @@ stages: targets: - name: Fedora 39 test: fedora39 - - name: Ubuntu 20.04 - test: ubuntu2004 - name: Ubuntu 22.04 test: ubuntu2204 - stage: Docker_2_16 @@ -168,8 +166,6 @@ stages: test: centos7 - name: Fedora 38 test: fedora38 - - name: Ubuntu 20.04 - test: ubuntu2004 - name: Ubuntu 22.04 test: ubuntu2204 @@ -187,8 +183,6 @@ stages: test: fedora37 - name: openSUSE 15 py3 test: opensuse15 - - name: Ubuntu 20.04 - test: ubuntu2004 - name: Ubuntu 22.04 test: ubuntu2204 diff --git a/changelogs/fragments/618_ci_remove_ubuntu2004.yml b/changelogs/fragments/618_ci_remove_ubuntu2004.yml new file mode 100644 index 0000000..2d63e7e --- /dev/null +++ b/changelogs/fragments/618_ci_remove_ubuntu2004.yml @@ -0,0 +1,2 @@ +trivial: + - Remove ubuntu20.04 from CI tests (https://github.com/ansible-collections/ansible.posix/issues/612). From 7b9b1f4957da395f3ed09835a9ce79a0932360ea Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Wed, 16 Apr 2025 05:38:49 +0000 Subject: [PATCH 19/29] Fixes issue related to updating the ansible-core devel branch * Fixes incorrect load path for json module in cgroup_perf_recap * Remove unnecessary condition from seboolean integration tests * Optimize conditions for selinux integration tests * Fixes #630 Signed-off-by: Hideki Saito --- changelogs/fragments/631_fixes_module_path.yml | 6 ++++++ plugins/callback/cgroup_perf_recap.py | 3 ++- tests/integration/targets/seboolean/tasks/main.yml | 1 - tests/integration/targets/selinux/tasks/main.yml | 6 ++---- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/631_fixes_module_path.yml diff --git a/changelogs/fragments/631_fixes_module_path.yml b/changelogs/fragments/631_fixes_module_path.yml new file mode 100644 index 0000000..7aad317 --- /dev/null +++ b/changelogs/fragments/631_fixes_module_path.yml @@ -0,0 +1,6 @@ +--- +bugfixes: + - ansible.posix.cgroup_perf_recap - fixes json module load path (https://github.com/ansible-collections/ansible.posix/issues/630). +trivial: + - ansible.posix.seboolean - remove unnecessary condition from seboolean integration tests (https://github.com/ansible-collections/ansible.posix/issues/630). + - ansible.posix.selinux - optimize conditions for selinux integration tests (https://github.com/ansible-collections/ansible.posix/issues/630). diff --git a/plugins/callback/cgroup_perf_recap.py b/plugins/callback/cgroup_perf_recap.py index d1f4247..6721a03 100644 --- a/plugins/callback/cgroup_perf_recap.py +++ b/plugins/callback/cgroup_perf_recap.py @@ -132,6 +132,7 @@ DOCUMENTATION = ''' import csv import datetime +import json import os import time import threading @@ -142,7 +143,7 @@ from functools import partial from ansible.module_utils._text import to_bytes, to_text from ansible.module_utils.six import with_metaclass -from ansible.parsing.ajson import AnsibleJSONEncoder, json +from ansible.parsing.ajson import AnsibleJSONEncoder from ansible.plugins.callback import CallbackBase diff --git a/tests/integration/targets/seboolean/tasks/main.yml b/tests/integration/targets/seboolean/tasks/main.yml index 4aad585..97a41d1 100644 --- a/tests/integration/targets/seboolean/tasks/main.yml +++ b/tests/integration/targets/seboolean/tasks/main.yml @@ -20,5 +20,4 @@ ansible.builtin.include_tasks: seboolean.yml when: - ansible_selinux is defined - - ansible_selinux - ansible_selinux.status == 'enabled' diff --git a/tests/integration/targets/selinux/tasks/main.yml b/tests/integration/targets/selinux/tasks/main.yml index 8d8db05..0531064 100644 --- a/tests/integration/targets/selinux/tasks/main.yml +++ b/tests/integration/targets/selinux/tasks/main.yml @@ -19,23 +19,21 @@ - name: Debug message for when SELinux is disabled ansible.builtin.debug: msg: SELinux is disabled - when: ansible_selinux is defined and not ansible_selinux + when: ansible_selinux is defined and ansible_selinux.status == 'disabled' - name: Debug message for when SELinux is enabled and not disabled ansible.builtin.debug: msg: SELinux is {{ ansible_selinux.status }} - when: ansible_selinux is defined and ansible_selinux + when: ansible_selinux is defined - name: Include_tasks for when SELinux is enabled ansible.builtin.include_tasks: selinux.yml when: - ansible_selinux is defined - - ansible_selinux - ansible_selinux.status == 'enabled' - name: Include tasks for selogin when SELinux is enabled ansible.builtin.include_tasks: selogin.yml when: - ansible_selinux is defined - - ansible_selinux - ansible_selinux.status == 'enabled' From 2f224e6a6adde7255e7c7ecf0a455f32610d39bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20M=C3=A9ndez=20Hern=C3=A1ndez?= Date: Thu, 10 Apr 2025 01:29:19 +0200 Subject: [PATCH 20/29] Add option to provide a different date/time format The new `datetime_format` key will offer the possibility of providing a different date/time format than the default one (`'%A %d %B %Y %H:%M:%S %z'`). - The `iso8601` value can be used as an `'%Y-%m-%dT%H:%M:%S.%f'` alias (format of the ISO 8601 date/time standard). The code has changed from using the `time` API to the `datetime` one in order to support sub-second precision (needed by the ISO 8601 format, for example). Signed-off-by: Pablo Mendez Hernandez --- .../626_profile_tasks_datetime_format.yml | 3 ++ plugins/callback/profile_tasks.py | 48 +++++++++++++------ 2 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 changelogs/fragments/626_profile_tasks_datetime_format.yml diff --git a/changelogs/fragments/626_profile_tasks_datetime_format.yml b/changelogs/fragments/626_profile_tasks_datetime_format.yml new file mode 100644 index 0000000..3a60e55 --- /dev/null +++ b/changelogs/fragments/626_profile_tasks_datetime_format.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - profile_tasks - Add option to provide a different date/time format (https://github.com/ansible-collections/ansible.posix/issues/279). diff --git a/plugins/callback/profile_tasks.py b/plugins/callback/profile_tasks.py index c5cc5fe..7cce85a 100644 --- a/plugins/callback/profile_tasks.py +++ b/plugins/callback/profile_tasks.py @@ -52,6 +52,17 @@ DOCUMENTATION = ''' - section: callback_profile_tasks key: summary_only version_added: 1.5.0 + datetime_format: + description: + - Datetime format, as expected by the C(strftime) and C(strptime) methods. + An C(iso8601) alias will be translated to C('%Y-%m-%dT%H:%M:%S.%f') if that datetime standard wants to be used. + default: '%A %d %B %Y %H:%M:%S %z' + env: + - name: PROFILE_TASKS_DATETIME_FORMAT + ini: + - section: callback_profile_tasks + key: datetime_format + version_added: 3.0.0 ''' EXAMPLES = ''' @@ -72,14 +83,15 @@ sample output: > ''' import collections -import time + +from datetime import datetime from ansible.module_utils.six.moves import reduce from ansible.plugins.callback import CallbackBase # define start time -t0 = tn = time.time() +dt0 = dtn = datetime.now().astimezone() def secondsToStr(t): @@ -104,17 +116,18 @@ def filled(msg, fchar="*"): def timestamp(self): if self.current is not None: - elapsed = time.time() - self.stats[self.current]['started'] + elapsed = (datetime.now().astimezone() - self.stats[self.current]['started']).total_seconds() self.stats[self.current]['elapsed'] += elapsed -def tasktime(): - global tn - time_current = time.strftime('%A %d %B %Y %H:%M:%S %z') - time_elapsed = secondsToStr(time.time() - tn) - time_total_elapsed = secondsToStr(time.time() - t0) - tn = time.time() - return filled('%s (%s)%s%s' % (time_current, time_elapsed, ' ' * 7, time_total_elapsed)) +def tasktime(self): + global dtn + cdtn = datetime.now().astimezone() + datetime_current = cdtn.strftime(self.datetime_format) + time_elapsed = secondsToStr((cdtn - dtn).total_seconds()) + time_total_elapsed = secondsToStr((cdtn - dt0).total_seconds()) + dtn = cdtn + return filled('%s (%s)%s%s' % (datetime_current, time_elapsed, ' ' * 7, time_total_elapsed)) class CallbackModule(CallbackBase): @@ -134,6 +147,7 @@ class CallbackModule(CallbackBase): self.sort_order = None self.summary_only = None self.task_output_limit = None + self.datetime_format = None super(CallbackModule, self).__init__() @@ -159,9 +173,14 @@ class CallbackModule(CallbackBase): else: self.task_output_limit = int(self.task_output_limit) + self.datetime_format = self.get_option('datetime_format') + if self.datetime_format is not None: + if self.datetime_format == 'iso8601': + self.datetime_format = '%Y-%m-%dT%H:%M:%S.%f' + def _display_tasktime(self): if not self.summary_only: - self._display.display(tasktime()) + self._display.display(tasktime(self)) def _record_task(self, task): """ @@ -176,10 +195,11 @@ class CallbackModule(CallbackBase): # with the same UUID is executed when `serial` is specified in a playbook. # elapsed: Elapsed time since the first serialized task was started self.current = task._uuid + dtn = datetime.now().astimezone() if self.current not in self.stats: - self.stats[self.current] = {'started': time.time(), 'elapsed': 0.0, 'name': task.get_name()} + self.stats[self.current] = {'started': dtn, 'elapsed': 0.0, 'name': task.get_name()} else: - self.stats[self.current]['started'] = time.time() + self.stats[self.current]['started'] = dtn if self._display.verbosity >= 2: self.stats[self.current]['path'] = task.get_path() @@ -196,7 +216,7 @@ class CallbackModule(CallbackBase): # Align summary report header with other callback plugin summary self._display.banner("TASKS RECAP") - self._display.display(tasktime()) + self._display.display(tasktime(self)) self._display.display(filled("", fchar="=")) timestamp(self) From 26b9b1438d0e966516b1efc7f7c6b2cff80f92d4 Mon Sep 17 00:00:00 2001 From: Klaas Demter Date: Mon, 19 May 2025 18:10:38 +0200 Subject: [PATCH 21/29] Remove EOL FreeBSD 13.2 from CI --- .azure-pipelines/azure-pipelines.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 699e4ff..b1b5dfd 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -237,8 +237,6 @@ stages: test: rhel/8.8 - name: RHEL 9.2 test: rhel/9.2 - - name: FreeBSD 13.2 - test: freebsd/13.2 - stage: Remote_2_15 displayName: Remote 2.15 @@ -254,8 +252,6 @@ stages: test: rhel/8.7 - name: RHEL 9.1 test: rhel/9.1 - - name: FreeBSD 13.2 - test: freebsd/13.2 ## Finally From f977bffff299b4710bcc34e7b982405af1a8a013 Mon Sep 17 00:00:00 2001 From: saito-hideki Date: Mon, 9 Jun 2025 17:55:46 +0900 Subject: [PATCH 22/29] [AZP] Add RHEL10 environment to CI matrix * Fixes #642 Signed-off-by: saito-hideki --- .azure-pipelines/azure-pipelines.yml | 2 ++ changelogs/fragments/642_ci_add_rhel10.yml | 2 ++ tests/integration/targets/acl/tasks/acl.yml | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 changelogs/fragments/642_ci_add_rhel10.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index b1b5dfd..3e43100 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -195,6 +195,8 @@ stages: parameters: testFormat: devel/{0}/1 targets: + - name: RHEL 10.0 + test: rhel/10.0 - name: RHEL 9.5 test: rhel/9.5 - name: FreeBSD 14.2 diff --git a/changelogs/fragments/642_ci_add_rhel10.yml b/changelogs/fragments/642_ci_add_rhel10.yml new file mode 100644 index 0000000..759ba31 --- /dev/null +++ b/changelogs/fragments/642_ci_add_rhel10.yml @@ -0,0 +1,2 @@ +trivial: + - Add Red Hat Enterprise Linux 10.0 to the CI matrix (https://github.com/ansible-collections/ansible.posix/issues/642). diff --git a/tests/integration/targets/acl/tasks/acl.yml b/tests/integration/targets/acl/tasks/acl.yml index 24846d0..9e8d13f 100644 --- a/tests/integration/targets/acl/tasks/acl.yml +++ b/tests/integration/targets/acl/tasks/acl.yml @@ -46,6 +46,12 @@ path: "{{ test_dir }}" state: directory mode: "0755" + +- name: Install acl package + ansible.builtin.package: + name: acl + state: present + ############################################################################## - name: Grant ansible user read access to a file ansible.posix.acl: From c319c856ed12650e0f5d5d070c8689b8275297ff Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 28 Jun 2025 16:29:29 +0200 Subject: [PATCH 23/29] Avoid deprecated/deleted callback functions. --- plugins/callback/profile_roles.py | 5 +---- plugins/callback/profile_tasks.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/plugins/callback/profile_roles.py b/plugins/callback/profile_roles.py index 270a74f..4d58014 100644 --- a/plugins/callback/profile_roles.py +++ b/plugins/callback/profile_roles.py @@ -124,10 +124,7 @@ class CallbackModule(CallbackBase): def v2_playbook_on_handler_task_start(self, task): self._record_task(task) - def playbook_on_setup(self): - self._display_tasktime() - - def playbook_on_stats(self, stats): + def v2_playbook_on_stats(self, stats): # Align summary report header with other callback plugin summary self._display.banner("ROLES RECAP") diff --git a/plugins/callback/profile_tasks.py b/plugins/callback/profile_tasks.py index 7cce85a..2945bf9 100644 --- a/plugins/callback/profile_tasks.py +++ b/plugins/callback/profile_tasks.py @@ -209,10 +209,7 @@ class CallbackModule(CallbackBase): def v2_playbook_on_handler_task_start(self, task): self._record_task(task) - def playbook_on_setup(self): - self._display_tasktime() - - def playbook_on_stats(self, stats): + def v2_playbook_on_stats(self, stats): # Align summary report header with other callback plugin summary self._display.banner("TASKS RECAP") From f9789985211b6165ad6f0cb07a6fa4c2f256f239 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 28 Jun 2025 16:34:47 +0200 Subject: [PATCH 24/29] Add changelog fragment. --- changelogs/fragments/650-profile_tasks_roles.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/650-profile_tasks_roles.yml diff --git a/changelogs/fragments/650-profile_tasks_roles.yml b/changelogs/fragments/650-profile_tasks_roles.yml new file mode 100644 index 0000000..d8664b8 --- /dev/null +++ b/changelogs/fragments/650-profile_tasks_roles.yml @@ -0,0 +1,2 @@ +minor_changes: + - "profile_tasks and profile_roles callback plugins - avoid deleted/deprecated callback functions, instead use modern interface that was introduced a longer time ago (https://github.com/ansible-collections/ansible.posix/issues/650)." From 40c27e2bee92edd368893ab8c066fbfd67a2fb0a Mon Sep 17 00:00:00 2001 From: saito-hideki Date: Thu, 10 Jul 2025 09:26:46 +0900 Subject: [PATCH 25/29] CI - bump ansible-core version * bump devel to ansible-core 2.20 * add ansible-core 2.19 to stable list Signed-off-by: saito-hideki --- .azure-pipelines/azure-pipelines.yml | 57 +++++++++++++++++-- .../fragments/654_ci_bump_core_version.yml | 3 + tests/sanity/ignore-2.20.txt | 1 + 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/654_ci_bump_core_version.yml create mode 100644 tests/sanity/ignore-2.20.txt diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 3e43100..4852f91 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -57,8 +57,23 @@ stages: test: units - name: Lint test: lint + - stage: Sanity_2_19 + displayName: Ansible 2.19 sanitay & Units & Lint + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + nameFormat: "{0}" + testFormat: 2.19/{0OI} + targets: + - name: Sanity + test: sanity + - name: Units + test: units + - name: Lint + test: lint - stage: Sanity_2_18 - displayName: Ansible 2.18 sanity + displayName: Ansible 2.18 sanity & Units & Lint dependsOn: [] jobs: - template: templates/matrix.yml @@ -73,10 +88,11 @@ stages: - name: Lint test: lint - stage: Sanity_2_17 - displayName: Ansible 2.17 sanity + displayName: Ansible 2.17 sanity & Units & Lint dependsOn: [] jobs: - template: templates/matrix.yml + I parameters: nameFormat: "{0}" testFormat: 2.17/{0} @@ -88,7 +104,7 @@ stages: - name: Lint test: lint - stage: Sanity_2_16 - displayName: Ansible 2.16 sanity + displayName: Ansible 2.16 sanity & Units & Lint dependsOn: [] jobs: - template: templates/matrix.yml @@ -101,7 +117,7 @@ stages: - name: Units test: units - stage: Sanity_2_15 - displayName: Ansible 2.15 sanity + displayName: Ansible 2.15 sanity & Units & Lint dependsOn: [] jobs: - template: templates/matrix.yml @@ -128,6 +144,20 @@ stages: test: ubuntu2204 - name: Ubuntu 24.04 test: ubuntu2404 + - stage: Docker_2_19 + displayName: Docker 2.19 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + testFormat: devel/linux/{0}/1 + targets: + - name: Fedora 41 + test: fedora41 + - name: Ubuntu 22.04 + test: ubuntu2204 + - name: Ubuntu 24.04 + test: ubuntu2404 - stage: Docker_2_18 displayName: Docker 2.18 dependsOn: [] @@ -203,6 +233,22 @@ stages: test: freebsd/14.2 - name: FreeBSD 13.5 test: freebsd/13.5 + - stage: Remote_2_19 + displayName: Remote 2.19 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + testFormat: devel/{0}/1 + targets: + - name: RHEL 10.0 + test: rhel/10.0 + - name: RHEL 9.5 + test: rhel/9.5 + - name: FreeBSD 14.2 + test: freebsd/14.2 + - name: FreeBSD 13.5 + test: freebsd/13.5 - stage: Remote_2_18 displayName: Remote 2.18 dependsOn: [] @@ -272,6 +318,9 @@ stages: - Sanity_2_18 - Remote_2_18 - Docker_2_18 + - Sanity_2_19 + - Remote_2_19 + - Docker_2_19 - Sanity_devel - Remote_devel - Docker_devel diff --git a/changelogs/fragments/654_ci_bump_core_version.yml b/changelogs/fragments/654_ci_bump_core_version.yml new file mode 100644 index 0000000..d738204 --- /dev/null +++ b/changelogs/fragments/654_ci_bump_core_version.yml @@ -0,0 +1,3 @@ +~-- +trivial: + - Bump ansible-core version to 2.20 of devel branch and add 2.19 to CI diff --git a/tests/sanity/ignore-2.20.txt b/tests/sanity/ignore-2.20.txt new file mode 100644 index 0000000..3cf68c0 --- /dev/null +++ b/tests/sanity/ignore-2.20.txt @@ -0,0 +1 @@ +tests/utils/shippable/timing.py shebang From 162e72182fe78258a7913f3f99e3c7f809bd29d1 Mon Sep 17 00:00:00 2001 From: Hideki SAITO Date: Thu, 17 Jul 2025 11:49:17 +0900 Subject: [PATCH 26/29] Fixed syntax error in azurepileline settings Signed-off-by: Hideki SAITO --- .azure-pipelines/azure-pipelines.yml | 3 +-- changelogs/fragments/654_ci_bump_core_version.yml | 2 +- changelogs/fragments/660_ci_azp_syntax.yml | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/660_ci_azp_syntax.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 4852f91..3aecaeb 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -64,7 +64,7 @@ stages: - template: templates/matrix.yml parameters: nameFormat: "{0}" - testFormat: 2.19/{0OI} + testFormat: 2.19/{0} targets: - name: Sanity test: sanity @@ -92,7 +92,6 @@ stages: dependsOn: [] jobs: - template: templates/matrix.yml - I parameters: nameFormat: "{0}" testFormat: 2.17/{0} diff --git a/changelogs/fragments/654_ci_bump_core_version.yml b/changelogs/fragments/654_ci_bump_core_version.yml index d738204..d150a81 100644 --- a/changelogs/fragments/654_ci_bump_core_version.yml +++ b/changelogs/fragments/654_ci_bump_core_version.yml @@ -1,3 +1,3 @@ -~-- +--- trivial: - Bump ansible-core version to 2.20 of devel branch and add 2.19 to CI diff --git a/changelogs/fragments/660_ci_azp_syntax.yml b/changelogs/fragments/660_ci_azp_syntax.yml new file mode 100644 index 0000000..1efd77a --- /dev/null +++ b/changelogs/fragments/660_ci_azp_syntax.yml @@ -0,0 +1,2 @@ +trivial: + - AZP - fixed syntax error in CI test. From 18e023dd779451adcdaf042f874d191422478106 Mon Sep 17 00:00:00 2001 From: saito-hideki Date: Mon, 28 Jul 2025 12:32:00 +0900 Subject: [PATCH 27/29] Update AZP matrix to follow ansible-test changes * https://github.com/ansible/ansible/pull/85558 * https://github.com/ansible/ansible/pull/85561 * https://github.com/ansible/ansible/pull/85562 Signed-off-by: saito-hideki --- .azure-pipelines/azure-pipelines.yml | 32 +++++++++---------- .../fragments/666_azp_update_20250728.yml | 3 ++ tests/integration/targets/firewalld/aliases | 2 ++ 3 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 changelogs/fragments/666_azp_update_20250728.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 3aecaeb..4ab33e9 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -137,8 +137,8 @@ stages: parameters: testFormat: devel/linux/{0}/1 targets: - - name: Fedora 41 - test: fedora41 + - name: Fedora 42 + test: fedora42 - name: Ubuntu 22.04 test: ubuntu2204 - name: Ubuntu 24.04 @@ -151,8 +151,8 @@ stages: parameters: testFormat: devel/linux/{0}/1 targets: - - name: Fedora 41 - test: fedora41 + - name: Fedora 42 + test: fedora42 - name: Ubuntu 22.04 test: ubuntu2204 - name: Ubuntu 24.04 @@ -226,10 +226,10 @@ stages: targets: - name: RHEL 10.0 test: rhel/10.0 - - name: RHEL 9.5 - test: rhel/9.5 - - name: FreeBSD 14.2 - test: freebsd/14.2 + - name: RHEL 9.6 + test: rhel/9.6 + - name: FreeBSD 14.3 + test: freebsd/14.3 - name: FreeBSD 13.5 test: freebsd/13.5 - stage: Remote_2_19 @@ -242,10 +242,10 @@ stages: targets: - name: RHEL 10.0 test: rhel/10.0 - - name: RHEL 9.5 - test: rhel/9.5 - - name: FreeBSD 14.2 - test: freebsd/14.2 + - name: RHEL 9.6 + test: rhel/9.6 + - name: FreeBSD 14.3 + test: freebsd/14.3 - name: FreeBSD 13.5 test: freebsd/13.5 - stage: Remote_2_18 @@ -258,8 +258,8 @@ stages: targets: - name: RHEL 9.4 test: rhel/9.4 - - name: FreeBSD 13.3 - test: freebsd/13.3 + - name: FreeBSD 13.5 + test: freebsd/13.5 - stage: Remote_2_17 displayName: Remote 2.17 dependsOn: [] @@ -270,8 +270,8 @@ stages: targets: - name: RHEL 9.3 test: rhel/9.3 - - name: FreeBSD 13.3 - test: freebsd/13.3 + - name: FreeBSD 13.5 + test: freebsd/13.5 - stage: Remote_2_16 displayName: Remote 2.16 dependsOn: [] diff --git a/changelogs/fragments/666_azp_update_20250728.yml b/changelogs/fragments/666_azp_update_20250728.yml new file mode 100644 index 0000000..d6b4b24 --- /dev/null +++ b/changelogs/fragments/666_azp_update_20250728.yml @@ -0,0 +1,3 @@ +--- +trivial: + - AZP - Update AZP matrix to follow ansible-test changes. diff --git a/tests/integration/targets/firewalld/aliases b/tests/integration/targets/firewalld/aliases index 95259df..f2b0fc9 100644 --- a/tests/integration/targets/firewalld/aliases +++ b/tests/integration/targets/firewalld/aliases @@ -1,3 +1,5 @@ +needs/privileged +needs/root destructive shippable/posix/group1 skip/aix From 9007e20b2fc00d4ee0d39deb2688a2234e826f1c Mon Sep 17 00:00:00 2001 From: saito-hideki Date: Mon, 28 Jul 2025 11:42:28 +0900 Subject: [PATCH 28/29] README updated with the release of Ansible Core 2.19 * https://docs.ansible.com/ansible/devel/roadmap/ROADMAP_2_19.html Signed-off-by: saito-hideki --- README.md | 11 +++++------ changelogs/fragments/665_update_readme_20250728.yml | 3 +++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/665_update_readme_20250728.yml diff --git a/README.md b/README.md index 5e333f1..a3548b0 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,10 @@ To upgrade the collection to the latest available version, run the following com ansible-galaxy collection install ansible.posix --upgrade ``` -You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version 1.0.0: +You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version 2.0.0: ```shell -ansible-galaxy collection install ansible.posix:==1.0.0 +ansible-galaxy collection install ansible.posix:==2.0.0 ``` See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. @@ -78,11 +78,10 @@ ansible-doc -t callback ansible.posix.profile_tasks The following ansible-core versions have been tested with this collection: -- ansible-core 2.19 (devel) -- ansible-core 2.18 (stable) * +- ansible-core 2.20 (devel) +- ansible-core 2.19 (stable) * +- ansible-core 2.18 (stable) - ansible-core 2.17 (stable) -- ansible-core 2.16 (stable) -- ansible-core 2.15 (stable) ## Contributing diff --git a/changelogs/fragments/665_update_readme_20250728.yml b/changelogs/fragments/665_update_readme_20250728.yml new file mode 100644 index 0000000..0b59713 --- /dev/null +++ b/changelogs/fragments/665_update_readme_20250728.yml @@ -0,0 +1,3 @@ +--- +trivial: + - README - Update README to reflect Ansible Core 2.19 release. From 2d350e6073a5844f26fb793cb3810a1043f3098a Mon Sep 17 00:00:00 2001 From: saito-hideki Date: Tue, 5 Aug 2025 09:38:24 +0900 Subject: [PATCH 29/29] AZP update CI matrix * Addresses #672 * Bump test container version 7.0.0 * Removes Ansible Core 2.15 tests. Python 3.11 is no longer supported in Container 7.0.0. Signed-off-by: saito-hideki --- .azure-pipelines/azure-pipelines.yml | 66 +++---------------- README.md | 2 +- .../fragments/673_update_ci_20250805.yml | 2 + meta/runtime.yml | 2 +- 4 files changed, 13 insertions(+), 59 deletions(-) create mode 100644 changelogs/fragments/673_update_ci_20250805.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 4ab33e9..cc2d866 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -37,7 +37,7 @@ variables: resources: containers: - container: default - image: quay.io/ansible/azure-pipelines-test-container:6.0.0 + image: quay.io/ansible/azure-pipelines-test-container:7.0.0 pool: Standard @@ -115,19 +115,6 @@ stages: test: sanity - name: Units test: units - - stage: Sanity_2_15 - displayName: Ansible 2.15 sanity & Units & Lint - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: "{0}" - testFormat: 2.15/{0} - targets: - - name: Sanity - test: sanity - - name: Units - test: units ## Docker - stage: Docker_devel displayName: Docker devel @@ -149,10 +136,10 @@ stages: jobs: - template: templates/matrix.yml parameters: - testFormat: devel/linux/{0}/1 + testFormat: 2.19/linux/{0}/1 targets: - - name: Fedora 42 - test: fedora42 + - name: Fedora 41 + test: fedora41 - name: Ubuntu 22.04 test: ubuntu2204 - name: Ubuntu 24.04 @@ -198,23 +185,6 @@ stages: - name: Ubuntu 22.04 test: ubuntu2204 - - stage: Docker_2_15 - displayName: Docker 2.15 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - testFormat: 2.15/linux/{0}/1 - targets: - - name: CentOS 7 - test: centos7 - - name: Fedora 37 - test: fedora37 - - name: openSUSE 15 py3 - test: opensuse15 - - name: Ubuntu 22.04 - test: ubuntu2204 - ## Remote - stage: Remote_devel displayName: Remote devel @@ -238,14 +208,14 @@ stages: jobs: - template: templates/matrix.yml parameters: - testFormat: devel/{0}/1 + testFormat: 2.19/{0}/1 targets: - name: RHEL 10.0 test: rhel/10.0 - - name: RHEL 9.6 - test: rhel/9.6 - - name: FreeBSD 14.3 - test: freebsd/14.3 + - name: RHEL 9.5 + test: rhel/9.5 + - name: FreeBSD 14.2 + test: freebsd/14.2 - name: FreeBSD 13.5 test: freebsd/13.5 - stage: Remote_2_18 @@ -285,29 +255,11 @@ stages: - name: RHEL 9.2 test: rhel/9.2 - - stage: Remote_2_15 - displayName: Remote 2.15 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - testFormat: 2.15/{0}/1 - targets: - - name: RHEL 7.9 - test: rhel/7.9 - - name: RHEL 8.7 - test: rhel/8.7 - - name: RHEL 9.1 - test: rhel/9.1 - ## Finally - stage: Summary condition: succeededOrFailed() dependsOn: - - Sanity_2_15 - - Remote_2_15 - - Docker_2_15 - Sanity_2_16 - Remote_2_16 - Docker_2_16 diff --git a/README.md b/README.md index a3548b0..189b69c 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and de * Python: * The Python interpreter version must meet Ansible Core's requirements. * Ansible Core: - - ansible-core 2.15 or later + - ansible-core 2.16 or later ## Installation diff --git a/changelogs/fragments/673_update_ci_20250805.yml b/changelogs/fragments/673_update_ci_20250805.yml new file mode 100644 index 0000000..6e47187 --- /dev/null +++ b/changelogs/fragments/673_update_ci_20250805.yml @@ -0,0 +1,2 @@ +trivial: + - Update AZP CI matrix (https://github.com/ansible-collections/ansible.posix/issues/673). diff --git a/meta/runtime.yml b/meta/runtime.yml index 1e85b01..49c7554 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,2 +1,2 @@ --- -requires_ansible: ">=2.15.0" +requires_ansible: ">=2.16.0"