111 Commits
Author SHA1 Message Date
Hideki SaitoandGitHub 90c3bd65bf Fix version_added for profile_tasks datetime_format (#784)
- Fixes #783
- Replaced version_added value with 2.2.0 for datetime_format

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-08-25 17:55:49 +09:00
Hideki SaitoandGitHub 713a132aaa [CI] Bump partner-certification-checker to v4.1.0 (#780)
- Fixes ansible-lint import crash

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-08-25 15:16:05 +09:00
Tom PaineandGitHub 5dd6507835 fix(callback): align profile_tasks recap output width (#773)
Use display.columns and get_text_width() for TASKS RECAP headers,
timestamps, and timing rows so output matches display.banner() width.
Add truncate_task_names (default false, version_added 2.3.0) with
display-width-aware truncation and padding for multibyte task names.
Add unit tests for ASCII and CJK recap rows, including the reproducer
from #773.
2026-08-25 09:19:51 +09:00
Hideki SaitoandGitHub ffdf9ef998 Update AZP to follow ansible-test (#775)
- Replace FreeBSD 15.0 with 15.1

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-08-07 14:16:48 +09:00
Hideki SaitoandGitHub ef1937b771 Update README Support section to reference Red Hat Automation Hub (#768)
Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-07-08 08:37:41 +09:00
Hideki SaitoandGitHub bf4e5d917e Remove meta-runtime[unsupported-version] line from the skip_list (#767)
Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-07-08 08:14:25 +09:00
Hideki SaitoandGitHub e114652e45 Replace remote test env RHEL9.7 and 10.1 with 9.8 and 10.2 (#763)
- Replace 9.7 with 9.8
- Replace 10.1 with 10.2
- Addresses https://github.com/ansible/ansible/pull/87120

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-07-01 10:39:34 +09:00
Hideki SaitoandGitHub 18f2f69c53 Fixes the symlink handling issue in the authorized_key module (#760)
- Addresses CVE-2026-11837
- Fixes #759

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-06-30 08:45:30 +09:00
Hideki SaitoandGitHub 674315f2da Replace AZP remote test FreeBSD-14.2 with 14.3 for Ansible Core 2.19 (#755)
Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-06-09 21:21:39 +09:00
Hideki SaitoandGitHub f7945c4bc9 [CI] AZP bump test container version to 8.0.0 (#751)
- Bump test container version to 8.0.0 for Ansible Core 2.18+
- Keep using 7.0.0 for Ansible Core 2.16 and 2.17. Both versions don't support Python3.13.

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-06-01 03:34:12 -07:00
Abhijeet KasurdeandGitHub f265682c99 sysctl: Doc update (#745)
* Make documentation more generic

Fixes: #411

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-27 08:42:16 +09:00
Abhijeet KasurdeandGitHub af933670cc authorized_key: Use loop instead of with_file in example (#740)
Fixes: #607

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-24 16:22:50 +09:00
Vladimir BotkaandGitHub 3c232a2429 In FreeBSD, fail if loader.conf shall be reloaded. (#664)
Fix #663
2026-05-20 08:43:23 -07:00
9cd0a1f0ef docs: added attributes metadata for check_mode support (fixes #643) (#741)
Co-authored-by: jkhall81 <jason.kei.hall@gmail.com>
2026-05-21 00:24:37 +09:00
Felix FonteinandGitHub 3059c5138c Fix changelog fragment. (#720)
The changelog fragment for #687 claims that a feature is removed, which isn't the case. It's a simple bugfix.
2026-05-17 23:40:16 +09:00
0cc6be274c Updated azure CI targets and readme (#713)
Added lastest branches and updated information
Normalized test versions to cover all supported ones

Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>
2026-05-17 18:39:23 +09:00
Abhijeet KasurdeandGitHub dbeb4a861d firewalld_info: Use PY2 compatible syntax (#719)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-15 12:07:12 -07:00
Abhijeet KasurdeandGitHub 4bd25f24e5 Remove non-essential Python requirements (#718)
Fixes: #652

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-14 16:55:49 +09:00
Abhijeet KasurdeandGitHub 7cbef04377 Removed ANSIBLE_METADATA from remaining plugins (#717)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-14 07:28:14 +09:00
ca22c6fe26 Fix _AnsibleActionDone deprecation in patch plugin (#687)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
2026-05-13 04:20:49 -07:00
Abhijeet KasurdeandGitHub d88a3c833c firewalld_info: Use module.warn (#715)
* Use module.warn to display warnings instead of module.exit_json

Fixes: #710

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-11 17:47:10 -07:00
centosinfra-prod-github-app[bot]andGitHub c4b1c2b0fb Merge pull request #638 from Silejonu/main
acl: correctly assert needed changes when recursive is true

SUMMARY
Right now, when setting recursive ACLs on a directory, all files in the directory are tested to check if a change is needed. If a single file has expected ACLs already set, then the test returns False and no changes are applied.
Fixes #592
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
acl
ADDITIONAL INFORMATION
I'm very much a beginner in Python, so any criticism is welcome.

Reviewed-by: Hideki Saito <saito@fgrep.org>
2026-05-08 06:22:12 +00:00
Abhijeet Kasurde 67e398bc62 test for ACL change
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-07 09:57:33 -04:00
SilejonuandAbhijeet Kasurde afa6471b73 refactor(acl): improve execution speed 2026-05-07 09:55:28 -04:00
SilejonuandAbhijeet Kasurde 871b4daeeb fix(acl): correctly assert needed changes when recursive is true 2026-05-07 09:55:28 -04:00
centosinfra-prod-github-app[bot]andGitHub fe77b17251 Merge pull request #712 from Akasurde/ignore_nuke
remove old ansible-core release

SUMMARY
Signed-off-by: Abhijeet Kasurde Akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
.azure-pipelines/azure-pipelines.yml

Reviewed-by: Hideki Saito <saito@fgrep.org>
2026-05-07 00:58:05 +00:00
Abhijeet Kasurde 28a09cd805 remove old ansible-core release
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-06 15:33:18 -04:00
Abhijeet Kasurde 853a333142 remove old ignore.txt
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-06 15:31:04 -04:00
centosinfra-prod-github-app[bot]andGitHub 2022c1bd86 Merge pull request #690 from barpavel/fix-686-module-utils-deprecation
Fix all deprecated module_utils imports before ansible-core 2.24 removal

SUMMARY
Fixes all deprecated ansible.module_utils imports across the entire collection that will be removed in ansible-core 2.24.
This PR comprehensively addresses deprecation warnings reported in #686 by updating import statements in 20 files to use the new recommended import paths, and removes 8 unused test utility files that contained deprecated imports.
Deprecated imports replaced:



Deprecated import
Replacement




ansible.module_utils._text
ansible.module_utils.common.text.converters


ansible.module_utils.common._collections_compat
collections.abc


ansible.module_utils.six.moves.shlex_quote
shlex.quote


ansible.module_utils.six.moves.reduce
functools.reduce


ansible.module_utils.six.moves.urllib.parse.urlparse
urllib.parse.urlparse


ansible.module_utils.six.string_types
basestring/str (Python 2/3 compatible)


ansible.module_utils.six.text_type
str


ansible.module_utils.six.PY3
Removed (simplified Python 2/3 conditionals)


ansible.module_utils.six.with_metaclass
Native metaclass= syntax


ansible.module_utils.six.iteritems
dict.items()



Files fixed (20 files, 1 commit per file for easier review):

plugins/action/patch.py
plugins/action/synchronize.py
plugins/callback/cgroup_perf_recap.py
plugins/callback/json.py
plugins/callback/jsonl.py
plugins/callback/profile_roles.py
plugins/callback/profile_tasks.py
plugins/modules/acl.py
plugins/modules/authorized_key.py
plugins/modules/firewalld_info.py
plugins/modules/mount.py
plugins/modules/patch.py
plugins/modules/rhel_rpm_ostree.py
plugins/modules/rpm_ostree_upgrade.py
plugins/modules/seboolean.py
plugins/modules/synchronize.py
plugins/modules/sysctl.py
plugins/shell/csh.py
plugins/shell/fish.py
tests/unit/modules/system/test_mount.py

Files deleted (8 unused test utility files):
These files are dead code - none of them are imported or used anywhere in the test suite or the collection. Removing them also addresses Python 2.7 compatibility concerns raised in code review, as several contained deprecated imports that would be incorrect to fix for Python 2.

tests/unit/compat/builtins.py
tests/unit/mock/loader.py
tests/unit/mock/path.py
tests/unit/mock/procenv.py
tests/unit/mock/vault_helper.py
tests/unit/mock/yaml_helper.py
tests/unit/modules/conftest.py
tests/unit/modules/utils.py

Completeness verified with:
git grep -n -P '_compat|utils._text|utils.six' -- '*.py' | grep -v yml

This command returns no results, confirming all deprecated imports have been replaced.
Notes on Python 2.7 compatibility:
For modules that may run on Python 2.7 managed hosts (e.g., authorized_key.py, synchronize.py, sysctl.py), Python 2/3 compatible fallbacks were used instead of direct Python 3 replacements:

authorized_key.py: try/except ImportError for urllib.parse.urlparse (falls back to urlparse on Python 2)
synchronize.py: try/except ImportError for shlex.quote (falls back to pipes.quote on Python 2)
sysctl.py: uses sys.version_info to set string_types to str on Python 3 (basestring on Python 2)

Also removes corresponding pylint:ansible-bad-import-from entries from tests/sanity/ignore-2.21.txt and tests/sanity/ignore-2.22.txt where applicable.
Fixes #686
ISSUE TYPE

Bugfix Pull Request

ADDITIONAL INFORMATION
Approach:
Each file is fixed in a separate commit for easier code review. The changelog fragment is added in a final commit. Corresponding pylint:ansible-bad-import-from ignore entries in tests/sanity/ignore-2.21.txt and tests/sanity/ignore-2.22.txt are removed in the same commit as the file fix (or the file removal commit).
CI results:
All 59 checks passing (Azure Pipelines sanity, units, lint, Docker, Remote across ansible-core 2.17 through devel, and Zuul ansible/check).

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Pavel Bar
Reviewed-by: Abhijeet Kasurde
2026-05-06 19:19:51 +00:00
Pavel BarandCursor AI 42d76de1cf Add changelog fragment for deprecated imports fix
Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 19:06:51 +03:00
Pavel BarandCursor AI fb2bc7b4b5 Remove unused test utility files
These files are dead code - none of them are imported or used anywhere
in the test suite or the collection:
- tests/unit/compat/builtins.py
- tests/unit/mock/loader.py
- tests/unit/mock/path.py
- tests/unit/mock/procenv.py
- tests/unit/mock/vault_helper.py
- tests/unit/mock/yaml_helper.py
- tests/unit/modules/conftest.py
- tests/unit/modules/utils.py

Removing these files also addresses Python 2.7 compatibility concerns
raised in code review, as several contained deprecated imports that
would be incorrect to fix for Python 2.

Also removes corresponding pylint:ansible-bad-import-from entries from
tests/sanity/ignore-2.21.txt.

Related to #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 19:06:51 +03:00
Pavel BarandCursor AI 9603ef890f Fix deprecated imports in tests/unit/modules/system/test_mount.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:15 +03:00
Pavel BarandCursor AI 513d50192d Fix deprecated imports in plugins/shell/fish.py
Replace deprecated module_utils imports:
- ansible.module_utils.six.text_type -> str
- ansible.module_utils.six.moves.shlex_quote -> shlex.quote

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:15 +03:00
Pavel BarandCursor AI 5cbe684b48 Fix deprecated imports in plugins/shell/csh.py
Replace deprecated module_utils imports:
- ansible.module_utils.six.text_type -> str
- ansible.module_utils.six.moves.shlex_quote -> shlex.quote

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:15 +03:00
Pavel BarandCursor AI 17dd3b2e01 Fix deprecated imports in plugins/modules/sysctl.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.string_types -> basestring/str (Python 2/3 compatible)

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 35bcea6ec9 Fix deprecated imports in plugins/modules/seboolean.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 065af18c26 Fix deprecated imports in plugins/modules/rpm_ostree_upgrade.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI a2fa110036 Fix deprecated imports in plugins/modules/rhel_rpm_ostree.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 935a644f3c Fix deprecated imports in plugins/modules/patch.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 37e46324f5 Fix deprecated imports in plugins/modules/firewalld_info.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 1aa2f974e9 Fix deprecated imports in plugins/modules/authorized_key.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.moves.urllib.parse -> urllib.parse

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 7c9c261faf Fix deprecated imports in plugins/modules/acl.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI bfe81d4388 Fix deprecated imports in plugins/callback/profile_tasks.py
Replace deprecated module_utils import:
- ansible.module_utils.six.moves.reduce -> functools.reduce

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI ba58f22d2e Fix deprecated imports in plugins/callback/profile_roles.py
Replace deprecated module_utils import:
- ansible.module_utils.six.moves.reduce -> functools.reduce

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 23a8948110 Fix deprecated imports in plugins/callback/jsonl.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 4f43537804 Fix deprecated imports in plugins/callback/json.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI e5f6e0be0c Fix deprecated imports in plugins/callback/cgroup_perf_recap.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.with_metaclass -> Python 3 metaclass syntax

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 25f4419e19 Fix deprecated imports in plugins/action/patch.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI f31b7a380b Fix deprecated imports in plugins/modules/mount.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.iteritems -> dict.items()

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 1f0844bf98 Fix deprecated imports in plugins/modules/synchronize.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.moves.shlex_quote -> shlex.quote

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 6462116447 Fix deprecated imports in plugins/action/synchronize.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.common._collections_compat -> collections.abc
- ansible.module_utils.six.string_types -> str
- ansible.module_utils.six.moves.shlex_quote -> shlex.quote

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
centosinfra-prod-github-app[bot]andGitHub 28b6db7845 Merge pull request #711 from saito-hideki/pr/ci_2026050500
[CI] Update Azure Pipelines distros and fix shebang

SUMMARY
Update Azure Pipelines distros and fix shebang:

Add devel targets for Docker and Remote stages
Split existing targets into 2.21 stages
Fix shebang in timing.py to pass sanity test

ISSUE TYPE

CI

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aklychko@redhat.com>
2026-05-05 12:57:42 +00:00
Hideki Saito 7709fbe168 [CI] Update Azure Pipelines distros and fix shebang
- Add devel targets for Docker and Remote stages
- Split existing targets into 2.21 stages
- Fix shebang in timing.py to pass sanity test
- Remove unnecessary shebang ignores from sanity ignore files

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-05-05 17:04:12 +09:00
Andrew KlychkovandGitHub 692b906b82 chore: remove .github/BOTMETA.yml (#706) 2026-02-25 09:38:38 +01:00
Andrew KlychkovandGitHub aece4a9632 ci: add certification.yml GitHub workflow (#705) 2026-02-25 09:38:02 +01:00
softwarefactory-project-zuul[bot]andGitHub 2cd1a6e4ab Merge pull request #704 from Andersson007/update_ci0
ci: .azure-pipelines/azure-pipelines.yml update distros

SUMMARY
ci: .azure-pipelines/azure-pipelines.yml update distros
As were reported in https://forum.ansible.com/t/ansible-test-images-and-vms-update-devel-2-20-2-19-2-18/45080
ISSUE TYPE


CI

Reviewed-by: Hideki Saito <saito@fgrep.org>
2026-02-25 08:19:39 +00:00
Andrew Klychkov 8af0b227cc ci: .azure-pipelines/azure-pipelines.yml update distros 2026-02-25 08:47:31 +01:00
softwarefactory-project-zuul[bot]andGitHub 5f44339fa5 Merge pull request #693 from saito-hideki/pr/ci_2025120500
[CI] Update AZP CI matrix and sanity tests

SUMMARY

Update AZP CI matrix. Bump the remote target version for 2.16 and 2.17
Add ignore file for Ansible Core 2.21 for the current devel version sanity test

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-12-09 05:56:49 +00:00
Hideki Saito 7d5aef07e2 Update AZP CI matrix and sanity test
* Update AZP CI matrix
* Add ignore file for Ansible Core 2.21
* Remove ignore lines for ansible-bad-import-from in 2.20 sanity tests

Signed-off-by: Hideki Saito <saito@fgrep.org>
2025-12-09 05:23:05 +00:00
softwarefactory-project-zuul[bot]andGitHub b39ee97ccc Merge pull request #677 from shenxianpeng/patch-1
docs: fix broken badge and restore coverage badge

SUMMARY
Replaced the outdated Shippable badge and active Codecov coverage badge, like other repos in ansible-collections org
ISSUE TYPE


Docs Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-11-28 07:14:56 +00:00
softwarefactory-project-zuul[bot]andGitHub 72a6eb9729 Merge pull request #639 from Klaas-/Klaas-fix_authorized_key
Fixes #462 notice permission denied on authorized_key module

SUMMARY
As of right now the authorized_key module does not notice on an "absent" if a authorized_keys file is simply not readable to the executing user. I am trying to fix that
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
authorized_key
ADDITIONAL INFORMATION


Execute as a user that does not have access to the root users authorized keys file

- name: Delete key from root user
  ansible.posix.authorized_key:
    state: absent
    user: root
    key: ssh-rsa xxxxxxxx

- name: Delete key from root user
  become: true
  ansible.posix.authorized_key:
    state: absent
    user: root
    key: ssh-rsa xxxxxxxx

The one without become will succeed before my change and will fail with a permission denied error after my change. The 2nd task will actually remove a key from root user if become privileges are available for the executing user

Reviewed-by: Brian Coca
Reviewed-by: Klaas Demter
Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-11-28 03:25:21 +00:00
9651a19805 change result.failed==True to result is failed in check_permissions.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-22 08:29:46 +02:00
Klaas Demter 413ab782a8 Fixes #462 notice permission denied on authorized_key module 2025-10-21 10:00:12 +02:00
softwarefactory-project-zuul[bot]andGitHub 9343c6f56f Merge pull request #682 from saito-hideki/pr/ci_update_20250929
Ignore pylint errors caused by compatibility checks for six

SUMMARY
Ignore pylint errors caused by compatibility checks for six:

pylint:ansible-bad-import-from

Ansible Core 2.16 supports Python2 environment,  and six is required to maintain compatibility with Python 2.
We plan to continue supporting Ansible Core 2.16 at this time.
Additionally, removing the standalone ansible-lint test because it is already included in ansible-test sanity.
ISSUE TYPE

CI tests Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aklychko@redhat.com>
Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-10-02 05:55:28 +00:00
saito-hideki 9dc73a686a Ignore pylint errors caused by compatibility checks for six
* This is a temporary measure until we stop covering Python2
* Skipped sanity[cannot-ignore] to keep backward compatibility with Python2
* Consolidate all ansible-lint option locations into .ansible-lint
* Fixed some typos

Signed-off-by: saito-hideki <saito@fgrep.org>
2025-10-02 14:02:56 +09:00
softwarefactory-project-zuul[bot]andGitHub 6da1331018 Merge pull request #670 from felixfontein/deprecations
Use module.warn() instead of returning warnings

SUMMARY
Returning warnings as warnings has been deprecated.
Ref: #635.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
firewalld_info
mount

Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-08-16 01:03:30 +00:00
Xianpeng ShenandGitHub cda2e0657f docs: fix broken badge and restore coverage badge 2025-08-14 14:33:30 +03:00
Felix Fontein ab8dfefd90 Use module.warn() instead of returning warnings. 2025-08-06 06:49:32 +02:00
softwarefactory-project-zuul[bot]andGitHub b96fad5e5b Merge pull request #673 from saito-hideki/pr/ci_update_20250805
[AZP] Update CI matrix

SUMMARY
Update AZP 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.

ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-08-05 23:44:46 +00:00
saito-hideki 2d350e6073 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 <saito@fgrep.org>
2025-08-05 14:30:30 +09:00
softwarefactory-project-zuul[bot]andGitHub ea6ef5c775 Merge pull request #665 from saito-hideki/pr/readme_20250728
Update README for release of Ansible Core 2.19

SUMMARY
README updated with the release of Ansible Core 2.19

https://docs.ansible.com/ansible/devel/roadmap/ROADMAP_2_19.html

ISSUE TYPE

Docs Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
N/A
2025-07-28 08:38:22 +00:00
saito-hideki 9007e20b2f 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 <saito@fgrep.org>
2025-07-28 17:12:02 +09:00
softwarefactory-project-zuul[bot]andGitHub 508e3d920f Merge pull request #666 from saito-hideki/pr/azp_update_matrix_20250728
[AZP][CI] Update AZP matrix to follow ansible-test changes

SUMMARY
Update AZP matrix to follow ansible-test changes

ansible/ansible/pull/85558
ansible/ansible/pull/85561
ansible/ansible/pull/85562

ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-07-28 06:32:06 +00:00
saito-hideki 18e023dd77 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 <saito@fgrep.org>
2025-07-28 14:59:14 +09:00
softwarefactory-project-zuul[bot]andGitHub d3204df536 Merge pull request #660 from saito-hideki/pr_azp_syntax
[AZP] Fixed syntax error in AZP settings

SUMMARY
Fixed syntax error in AZP settings
ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-07-17 03:39:40 +00:00
Hideki SAITO 162e72182f Fixed syntax error in azurepileline settings
Signed-off-by: Hideki SAITO <hsaito@macallan.home.fgrep.org>
2025-07-17 12:16:09 +09:00
softwarefactory-project-zuul[bot]andGitHub 1c1dd005c8 Merge pull request #654 from saito-hideki/pr/bump_core_version_220
[CI] bump ansible-core version to 2.20 for devel branch

SUMMARY
Bump ansible-core version to 2.20 for devel branch.

Bump devel test to ansible-core 2.19
Add ansible-core 2.18 to the stable list

ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-07-10 01:00:47 +00:00
saito-hideki 40c27e2bee 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 <saito@fgrep.org>
2025-07-10 09:35:28 +09:00
softwarefactory-project-zuul[bot]andGitHub c273ac2a01 Merge pull request #650 from felixfontein/callback
profile_* callbacks: avoid deprecated/deleted functions

SUMMARY
The profile_roles and profile_tasks callbacks define methods playbook_on_setup and playbook_on_stats which have been deleted/deprecated:

playbook_on_stats has been deprecated, v2_playbook_on_stats should be used instead (that one has already been there for many years: ansible/ansible@ba0e532 was added in 2015).
playbook_on_setup has been deleted (ansible/ansible@eec57ec), and its v2 variant was already deleted in 2017: ansible/ansible@59d5481

Ref: #635
ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
profile_roles
profile_tasks

Reviewed-by: Abhijeet Kasurde
Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-07-08 05:47:53 +00:00
Felix Fontein f978998521 Add changelog fragment. 2025-06-28 16:34:47 +02:00
Felix Fontein c319c856ed Avoid deprecated/deleted callback functions. 2025-06-28 16:29:29 +02:00
softwarefactory-project-zuul[bot]andGitHub cdb442ea48 Merge pull request #646 from saito-hideki/issue/642
[AZP] Add RHEL10 environment to CI matrix

SUMMARY
Add RHEL10 environment to CI matrix

Fixes #642

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
N/A
2025-06-09 10:07:53 +00:00
saito-hideki f977bffff2 [AZP] Add RHEL10 environment to CI matrix
* Fixes #642

Signed-off-by: saito-hideki <saito@fgrep.org>
2025-06-09 18:43:43 +09:00
softwarefactory-project-zuul[bot]andGitHub dabaca4b70 Merge pull request #640 from Klaas-/Klaas-fixCI
Remove EOL FreeBSD 13.2 from CI

SUMMARY

CI seems to be failing for a month, reason is that freebsd 13.2 is no longer valid.
See ansible-collections/community.general#8607

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
CI

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-05-20 00:22:19 +00:00
Klaas Demter 26b9b1438d Remove EOL FreeBSD 13.2 from CI 2025-05-19 18:10:38 +02:00
softwarefactory-project-zuul[bot]andGitHub 1994b2cf1c Merge pull request #626 from pablomh/datetime_format
plugins/callback/profile_tasks.py: Add option to provide a different date/time format

SUMMARY
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).
Fixes: #279
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/callback/profile_tasks.py
ADDITIONAL INFORMATION

Output with no key which keeps current behavior:

TASK [Import subscription manifest] *******************************************************************************************************************************************************************************************************************************************************************
Thursday 10 April 2025  00:52:11 +0200 (0:00:17.416)       0:00:17.453 ******** 
changed: [localhost]


Output with datetime_format = 'iso8601':

TASK [Import subscription manifest] *******************************************************************************************************************************************************************************************************************************************************************
2025-04-10T00:55:19.967718 (0:00:15.664)       0:00:15.691 ******************** 
changed: [localhost]


Output with datetime_format = '%Y-%m-%dT%H:%M:%S.%f%z' (ISO 8601 with UTC offset information):

TASK [Import subscription manifest] *******************************************************************************************************************************************************************************************************************************************************************
2025-04-10T00:57:49.290347+0200 (0:00:16.265)       0:00:16.293 *************** 
changed: [localhost]

Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-04-25 06:44:25 +00:00
Pablo Méndez Hernández 2f224e6a6a 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 <pablomh@redhat.com>
2025-04-17 15:57:00 +02:00
softwarefactory-project-zuul[bot]andGitHub 96ec2097cc Merge pull request #631 from saito-hideki/issue/630
Fixes issue related to latest ansible-core devel branch

SUMMARY
Fixes a bug 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

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.cgroup_perf_recap

ADDITIONAL INFORMATION
N/A
2025-04-17 00:34:06 +00:00
Hideki Saito 7b9b1f4957 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 <saito@fgrep.org>
2025-04-17 00:11:31 +00:00
softwarefactory-project-zuul[bot]andGitHub f0b5f039d3 Merge pull request #613 from simonLeary42/rewrite-mount-tests
improve mount integration tests

SUMMARY

added check mode tests (assert no changes made)
added comments to make file less scary

ISSUE TYPE
tests
COMPONENT NAME
mount
ADDITIONAL INFORMATION

Reviewed-by: Abhijeet Kasurde
Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-04-10 03:58:40 +00:00
softwarefactory-project-zuul[bot]andGitHub 5ceb40b600 Merge pull request #618 from saito-hideki/issie/612
[AZP] Remove ubuntu20.04 from CI tests

SUMMARY
Remove ubuntu20.04 from CI tests

Fixes #612

ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-03-28 01:32:12 +00:00
Hideki Saito 2cec8cbed5 [CI] Remove ubuntu20.04 from CI tests
* Fixes #612

Signed-off-by: Hideki Saito <saito@fgrep.org>
2025-03-28 10:04:16 +09:00
Pavel KnoblokhandGitHub 1b8aeb03cb sysctl: Add custom sysctl file example (#606) 2025-03-26 19:21:08 -07:00
Abhijeet KasurdeandGitHub eead50b287 Apply suggestions from code review 2025-03-26 12:36:08 -07:00
Simon Leary 4ff0e3aa13 remove assertion of changed 2025-03-26 15:20:42 -04:00
Simon Leary 979f00ce75 fix lint errors 2025-03-26 15:18:35 -04:00
softwarefactory-project-zuul[bot]andGitHub ed3d322fd5 Merge pull request #617 from Akasurde/ci_fix
[CI] update test containers

SUMMARY
Signed-off-by: Abhijeet Kasurde Akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

Reviewed-by: Matt Clay
2025-03-26 19:00:30 +00:00
Abhijeet Kasurde d9f54eb9d4 [CI] update test containers
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2025-03-26 09:02:59 -07:00
Simon Leary 7d8da00f79 add (check mode) to task name 2025-03-06 10:46:57 -05:00
Simon Leary f087d58cbe fix bugs 2025-03-05 00:39:46 +00:00
Simon Leary eb740e97d4 add check mode tests, add comments 2025-03-05 00:33:11 +00:00
softwarefactory-project-zuul[bot]andGitHub 44a2151dbf Merge pull request #604 from saito-hideki/pr/bump_up_version_3.0.0
Bump version to 3.0.0 for the next release

SUMMARY
Bump version to 3.0.0 for the next release on main branch:

Fixes #603

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

None
2024-12-10 08:59:03 +00:00
Hideki Saito 83288b9020 Bump version to 3.0.0 for the next release
* Fixes #603

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-12-10 17:30:22 +09:00
softwarefactory-project-zuul[bot]andGitHub 4c6898ee6e Merge pull request #600 from saito-hideki/release_2.0.0
Release 2.0.0 commit

SUMMARY
Release 2.0.0 commit

Release Plan #149

ISSUE TYPE
Feature Pull Request
COMPONENT NAME
ansible.posix
ADDITIONAL INFORMATION
This will be merged on 5 December if there are no problems

Reviewed-by: Adam Miller <admiller@redhat.com>
Reviewed-by: Andrew Klychkov <aklychko@redhat.com>
2024-12-05 00:48:30 +00:00
Hideki Saito f5eae12146 Release 2.0.0 commit
Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-12-04 09:46:44 +09:00
softwarefactory-project-zuul[bot]andGitHub f632fad9d4 Merge pull request #598 from saito-hideki/issue/586
[Breaking Change] [firewalld] Change type of icmp_block_inversion option from str to bool

SUMMARY
Changed the type of icmp_block_inversion option from str to bool

Fixes #586

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.firewalld

ADDITIONAL INFORMATION
Related  #582 and #584

Reviewed-by: Adam Miller <admiller@redhat.com>
Reviewed-by: Andrew Klychkov <aklychko@redhat.com>
2024-12-02 23:50:26 +00:00
softwarefactory-project-zuul[bot]andGitHub 74edb72249 Merge pull request #597 from vbotka/mount-fix-comment
Remove comment from fstab entry on updating.

SUMMARY
Fix #595.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ansible.posix.mount
ADDITIONAL INFORMATION

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Vladimir Botka <vbotka@gmail.com>
2024-11-29 02:59:28 +00:00
Vladimir Botka 91129ed381 Fix changelog fragment module name. 2024-11-29 03:34:14 +01:00
Vladimir Botka 7b8d627552 Changelog fragment added. 2024-11-28 08:17:41 +01:00
Hideki Saito 6175a5028b Change type of icmp_block_inversion option from str to bool
* Fixes #586

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-11-28 14:19:20 +09:00
Vladimir Botka 8e34860d6c Fix #595. Remove comment from fstab entry on updating. 2024-11-21 20:54:27 +01:00
41 changed files with 327 additions and 256 deletions
+2 -2
View File
@@ -277,8 +277,8 @@ stages:
test: rhel/9.8
- name: FreeBSD 14.4
test: freebsd/14.4
- name: FreeBSD 15.0
test: freebsd/15.0
- name: FreeBSD 15.1
test: freebsd/15.1
- stage: Remote_2_21
displayName: Remote 2.21
+1 -1
View File
@@ -32,4 +32,4 @@ concurrency:
# for each affected version of ansible-core (for example, `tests/sanity/ignore-2.18.txt`) and add corresponding entries.
jobs:
call:
uses: ansible-collections/partner-certification-checker/.github/workflows/certification-reusable.yml@v0.1
uses: ansible-collections/partner-certification-checker/.github/workflows/certification-reusable.yml@v4.1.0
-102
View File
@@ -4,108 +4,6 @@ ansible.posix Release Notes
.. contents:: Topics
v2.2.2
======
Release Summary
---------------
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.2.1
Bugfixes
--------
- README - Added ``Red Hat Automation Hub`` as correct contact information for Red Hat Ansible Automation Platform subscribers.
v2.2.1
======
Release Summary
---------------
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.2.0
Security Fixes
--------------
- authorized_key - fix local privilege escalation via symlink-following when running as root (https://github.com/ansible-collections/ansible.posix/issues/759).
Bugfixes
--------
- sysctl - reload sysctl only if the sysctl file is ``/etc/sysctl.conf`` or ``/etc/sysctl.conf.local`` (https://github.com/ansible-collections/ansible.posix/issues/663).
v2.2.0
======
Release Summary
---------------
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.1.0
Minor Changes
-------------
- acl - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- authorized_key - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- cgroup_perf_recap callback - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- csh shell plugin - fix deprecated ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- firewalld_info - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- firewalld_info - use module.warn instead of passing ``warnings`` to ``exit_json`` (https://github.com/ansible-collections/ansible.posix/issues/710).
- fish shell plugin - fix deprecated ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- json callback - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- jsonl callback - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- mount - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- patch - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- profile_roles callback - fix deprecated ``ansible.module_utils.six`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- profile_tasks - Add option to provide a different date/time format (https://github.com/ansible-collections/ansible.posix/issues/279).
- profile_tasks callback - fix deprecated ``ansible.module_utils.six`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- removed ANSIBLE_METADATA from remaining plugins.
- rhel_rpm_ostree - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- rpm_ostree_upgrade - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- seboolean - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- synchronize - fix deprecated ``ansible.module_utils._text``, ``ansible.module_utils.common._collections_compat``, and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- sysctl - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
Bugfixes
--------
- acl - correctly assert needed changes when pointing to a directory and recursive is set to true.
- ansible.posix.authorized_key - fixes error on permission denied in authorized_key module (https://github.com/ansible-collections/ansible.posix/issues/462).
- firewalld_info - stop returning warnings as return values; this has been deprecated by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670).
- mount - stop returning warnings as return values; this has been deprecated by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670).
- patch - removed use of deprecated ``_AnsibleActionDone`` API (https://github.com/ansible-collections/ansible.posix/pull/687).
v2.1.0
======
Release Summary
---------------
This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.0.0
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).
Bugfixes
--------
- ansible.posix.cgroup_perf_recap - fixes json module load path (https://github.com/ansible-collections/ansible.posix/issues/630).
v2.0.0
======
-129
View File
@@ -490,132 +490,3 @@ releases:
- 597_remove_fstab_comment_on_updating.yml
- 598_icmp_block_inversion.yml
release_date: '2024-12-04'
2.1.0:
changes:
bugfixes:
- ansible.posix.cgroup_perf_recap - fixes json module load path (https://github.com/ansible-collections/ansible.posix/issues/630).
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).
release_summary: 'This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.0.0'
fragments:
- 2.1.0.yml
- 631_fixes_module_path.yml
- 642_ci_add_rhel10.yml
- 650-profile_tasks_roles.yml
- 654_ci_bump_core_version.yml
release_date: '2025-07-16'
2.2.0:
changes:
bugfixes:
- acl - correctly assert needed changes when pointing to a directory and recursive
is set to true.
- ansible.posix.authorized_key - fixes error on permission denied in authorized_key
module (https://github.com/ansible-collections/ansible.posix/issues/462).
- firewalld_info - stop returning warnings as return values; this has been deprecated
by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670).
- mount - stop returning warnings as return values; this has been deprecated
by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670).
- patch - removed use of deprecated ``_AnsibleActionDone`` API (https://github.com/ansible-collections/ansible.posix/pull/687).
minor_changes:
- acl - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- authorized_key - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six``
imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- cgroup_perf_recap callback - fix deprecated ``ansible.module_utils._text``
and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- csh shell plugin - fix deprecated ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- firewalld_info - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- firewalld_info - use module.warn instead of passing ``warnings`` to ``exit_json``
(https://github.com/ansible-collections/ansible.posix/issues/710).
- fish shell plugin - fix deprecated ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- json callback - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- jsonl callback - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- mount - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six``
imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- patch - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- profile_roles callback - fix deprecated ``ansible.module_utils.six`` import
(https://github.com/ansible-collections/ansible.posix/issues/686).
- profile_tasks - Add option to provide a different date/time format (https://github.com/ansible-collections/ansible.posix/issues/279).
- profile_tasks callback - fix deprecated ``ansible.module_utils.six`` import
(https://github.com/ansible-collections/ansible.posix/issues/686).
- removed ANSIBLE_METADATA from remaining plugins.
- rhel_rpm_ostree - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- rpm_ostree_upgrade - fix deprecated ``ansible.module_utils._text`` import
(https://github.com/ansible-collections/ansible.posix/issues/686).
- seboolean - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- synchronize - fix deprecated ``ansible.module_utils._text``, ``ansible.module_utils.common._collections_compat``,
and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- sysctl - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six``
imports (https://github.com/ansible-collections/ansible.posix/issues/686).
release_summary: 'This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.1.0'
fragments:
- 2.2.0.yml
- 626_profile_tasks_datetime_format.yml
- 638_fix_recursive_acl.yml
- 639_fix_authorized_key.yml
- 660_ci_azp_syntax.yml
- 665_update_readme_20250728.yml
- 666_azp_update_20250728.yml
- 670-deprecations.yml
- 673_update_ci_20250805.yml
- 682_update_ci_20250929.yml
- 686_fix_deprecated_imports.yml
- 693_azp_update_20251205.yml
- ansible_metadata_removed.yml
- firewalld_info_warnings.yml
- patch_removed.yml
release_date: '2026-05-18'
2.2.1:
changes:
bugfixes:
- sysctl - reload sysctl only if the sysctl file is ``/etc/sysctl.conf`` or
``/etc/sysctl.conf.local`` (https://github.com/ansible-collections/ansible.posix/issues/663).
release_summary: 'This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.2.0'
security_fixes:
- authorized_key - fix local privilege escalation via symlink-following when
running as root (https://github.com/ansible-collections/ansible.posix/issues/759).
fragments:
- 2.2.1.yml
- 643-sysctl-docs.yml
- 751_ci_test_container_update.yml
- 755_ci_test_container_update.yml
- 759_cve_2026_11837.yml
- 763_ci_azp_update_devel.yml
- freebsd_sysctl.yml
release_date: '2026-07-01'
2.2.2:
changes:
bugfixes:
- README - Added ``Red Hat Automation Hub`` as correct contact information for
Red Hat Ansible Automation Platform subscribers.
release_summary: 'This is the minor release of the ``ansible.posix`` collection.
This changelog contains all changes to the modules and plugins
in the stable-2 branch that have been added after the release of
``ansible.posix`` 2.2.1'
fragments:
- 2.2.2.yml
- 767_remove_unsupported_version_skip.yml
- 768_update_support_section.yml
release_date: '2026-07-08'
@@ -0,0 +1,2 @@
trivial:
- Bump version to 3.0.0 for the next release (https://github.com/ansible-collections/ansible.posix/issues/603).
@@ -0,0 +1,2 @@
trivial:
- Remove ubuntu20.04 from CI tests (https://github.com/ansible-collections/ansible.posix/issues/612).
@@ -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).
@@ -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).
@@ -0,0 +1,2 @@
bugfixes:
- acl - correctly assert needed changes when pointing to a directory and recursive is set to true.
@@ -0,0 +1,3 @@
---
bugfixes:
- ansible.posix.authorized_key - fixes error on permission denied in authorized_key module (https://github.com/ansible-collections/ansible.posix/issues/462).
@@ -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).
+3
View File
@@ -0,0 +1,3 @@
---
trivial:
- sysctl - added the attributes section to the module documentation to reflect check_mode support (https://github.com/ansible-collections/ansible.posix/issues/643).
@@ -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)."
@@ -0,0 +1,3 @@
---
trivial:
- Bump ansible-core version to 2.20 of devel branch and add 2.19 to CI
@@ -0,0 +1,2 @@
trivial:
- AZP - fixed syntax error in CI test.
@@ -0,0 +1,3 @@
---
trivial:
- README - Update README to reflect Ansible Core 2.19 release.
@@ -0,0 +1,3 @@
---
trivial:
- AZP - Update AZP matrix to follow ansible-test changes.
@@ -0,0 +1,3 @@
bugfixes:
- "firewalld_info - stop returning warnings as return values; this has been deprecated by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670)."
- "mount - stop returning warnings as return values; this has been deprecated by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670)."
@@ -0,0 +1,2 @@
trivial:
- Update AZP CI matrix (https://github.com/ansible-collections/ansible.posix/issues/673).
@@ -0,0 +1,4 @@
trivial:
- Updatng AZP CI matrix to ignore ansible-bad-import-from on six(https://github.com/ansible-collections/ansible.posix/pull/682).
- Skipped sanity[cannot-ignore] to keep backward compatibility with Python2.
- Consolidate all ansible-lint option locations into .ansible-lint file.
@@ -0,0 +1,19 @@
---
minor_changes:
- acl - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- authorized_key - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- cgroup_perf_recap callback - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- csh shell plugin - fix deprecated ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- firewalld_info - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- fish shell plugin - fix deprecated ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- json callback - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- jsonl callback - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- mount - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- patch - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- profile_roles callback - fix deprecated ``ansible.module_utils.six`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- profile_tasks callback - fix deprecated ``ansible.module_utils.six`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- rhel_rpm_ostree - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- rpm_ostree_upgrade - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- seboolean - fix deprecated ``ansible.module_utils._text`` import (https://github.com/ansible-collections/ansible.posix/issues/686).
- synchronize - fix deprecated ``ansible.module_utils._text``, ``ansible.module_utils.common._collections_compat``, and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
- sysctl - fix deprecated ``ansible.module_utils._text`` and ``ansible.module_utils.six`` imports (https://github.com/ansible-collections/ansible.posix/issues/686).
@@ -0,0 +1,5 @@
---
trivial:
- AZP - Update AZP matrix to follow ansible-test changes.
- Add ignore file for Ansible Core 2.21.
- Remove ignore lines for ansible-bad-import-from in 2.20 sanity tests.
@@ -0,0 +1,3 @@
---
trivial:
- Update Azure Pipelines test container to 8.0.0 and use legacy container for ansible-core 2.16/2.17.
@@ -0,0 +1,3 @@
---
trivial:
- Replace AZP remote test FreeBSD-14.2 with 14.3 for Ansible Core 2.19.
@@ -0,0 +1,2 @@
security_fixes:
- authorized_key - fix local privilege escalation via symlink-following when running as root (https://github.com/ansible-collections/ansible.posix/issues/759).
@@ -0,0 +1,3 @@
---
trivial:
- Replace AZP remote test RHEL9.7 and RHEL10.1 with 9.8 and 10.2 for devel branch.
@@ -0,0 +1,4 @@
---
trivial:
- ansible-lint - Removed ``meta-runtime[unsupported-version]`` from the skip_list in ``.ansible-lint``.
...
@@ -0,0 +1,4 @@
---
bugfixes:
- README - Added ``Red Hat Automation Hub`` as correct contact information for Red Hat Ansible Automation Platform subscribers.
...
@@ -0,0 +1,5 @@
---
bugfixes:
- profile_tasks callback - align TASKS RECAP output with ``display.banner()`` width instead of a hardcoded 79 columns (https://github.com/ansible-collections/ansible.posix/pull/773).
minor_changes:
- profile_tasks callback - add ``truncate_task_names`` option (default ``false``) to ellipsize long task names in the TASKS RECAP summary (https://github.com/ansible-collections/ansible.posix/pull/773).
@@ -0,0 +1,3 @@
---
trivial:
- AZP - Update AZP matrix to follow ansible-test changes.
@@ -0,0 +1,4 @@
---
trivial:
- CI - Bump partner-certification-checker to v4.1.0 to fix ansible-lint compatibility.
...
@@ -0,0 +1,4 @@
---
bugfixes:
- profile_tasks - fix incorrect ``version_added`` for ``datetime_format`` option(https://github.com/ansible-collections/ansible.posix/issues/783).
...
@@ -0,0 +1,3 @@
---
minor_changes:
- removed ANSIBLE_METADATA from remaining plugins.
@@ -0,0 +1,3 @@
---
minor_changes:
- firewalld_info - use module.warn instead of passing ``warnings`` to ``exit_json`` (https://github.com/ansible-collections/ansible.posix/issues/710).
+3
View File
@@ -0,0 +1,3 @@
---
bugfixes:
- sysctl - reload sysctl only if the sysctl file is ``/etc/sysctl.conf`` or ``/etc/sysctl.conf.local`` (https://github.com/ansible-collections/ansible.posix/issues/663).
+3
View File
@@ -0,0 +1,3 @@
---
bugfixes:
- patch - removed use of deprecated ``_AnsibleActionDone`` API (https://github.com/ansible-collections/ansible.posix/pull/687).
+1 -1
View File
@@ -1,7 +1,7 @@
---
namespace: ansible
name: posix
version: 2.2.2
version: 3.0.0
readme: README.md
authors:
- Ansible (github.com/ansible)
+91 -16
View File
@@ -62,7 +62,18 @@ DOCUMENTATION = '''
ini:
- section: callback_profile_tasks
key: datetime_format
version_added: 3.0.0
version_added: 2.2.0
truncate_task_names:
description:
- Truncate long task names in the TASKS RECAP summary with an ellipsis so rows stay within the terminal width.
type: bool
default: false
env:
- name: PROFILE_TASKS_TRUNCATE_TASK_NAMES
ini:
- section: callback_profile_tasks
key: truncate_task_names
version_added: 2.3.0
'''
EXAMPLES = '''
@@ -88,6 +99,7 @@ from datetime import datetime
from functools import reduce
from ansible.plugins.callback import CallbackBase
from ansible.utils.display import get_text_width
# define start time
@@ -102,16 +114,64 @@ def secondsToStr(t):
return "%d:%02d:%02d.%03d" % tuple(reduce(rediv, [[t * 1000, ], 1000, 60, 60]))
def filled(msg, fchar="*"):
if len(msg) == 0:
width = 79
def filled(msg, columns, fchar="*"):
"""Fill to the same width as display.banner() (columns + 1)."""
if not msg:
return fchar * (columns + 1)
try:
msg_width = get_text_width(msg)
except EnvironmentError:
msg_width = len(msg)
fill_len = columns - msg_width
if fill_len < 3:
fill_len = 3
return "%s %s" % (msg, fchar * fill_len)
def _text_width(text):
try:
return get_text_width(text)
except EnvironmentError:
return len(text)
def truncate_name(name, width):
if width <= 0:
return name
if _text_width(name) <= width:
return name
if width <= 3:
return name[:width]
ellipsis = '...'
for end in range(len(name), 0, -1):
candidate = name[:end] + ellipsis
if _text_width(candidate) <= width:
return candidate
return ellipsis
def pad_to_display_width(text, width, fillchar='-'):
current = _text_width(text)
if current >= width:
return text
return text + fillchar * (width - current)
def format_timing_row(task_name, elapsed, columns, truncate=False):
line_width = columns + 1
time_field_width = 9
name_field_width = line_width - time_field_width
if truncate:
task_name = truncate_name(task_name, name_field_width - 1)
prefix = task_name + u' '
gap = name_field_width - _text_width(prefix)
if gap == 1:
# A lone dash before the timing field looks like misaligned padding.
left = prefix + u' '
else:
msg = "%s " % msg
width = 79 - len(msg)
if width < 3:
width = 3
filler = fchar * width
return "%s%s " % (msg, filler)
left = pad_to_display_width(prefix, name_field_width)
timing = u' {0:.02f}s'.format(elapsed)
return left + timing.rjust(time_field_width, u'-')
def timestamp(self):
@@ -127,7 +187,10 @@ def tasktime(self):
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))
return filled(
'%s (%s)%s%s' % (datetime_current, time_elapsed, ' ' * 7, time_total_elapsed),
self._display.columns,
)
class CallbackModule(CallbackBase):
@@ -148,6 +211,7 @@ class CallbackModule(CallbackBase):
self.summary_only = None
self.task_output_limit = None
self.datetime_format = None
self.truncate_task_names = None
super(CallbackModule, self).__init__()
@@ -178,6 +242,8 @@ class CallbackModule(CallbackBase):
if self.datetime_format == 'iso8601':
self.datetime_format = '%Y-%m-%dT%H:%M:%S.%f'
self.truncate_task_names = self.get_option('truncate_task_names')
def _display_tasktime(self):
if not self.summary_only:
self._display.display(tasktime(self))
@@ -210,11 +276,12 @@ class CallbackModule(CallbackBase):
self._record_task(task)
def v2_playbook_on_stats(self, stats):
# Align summary report header with other callback plugin summary
self._display.banner("TASKS RECAP")
columns = self._display.columns
line_width = columns + 1
self._display.display(filled("TASKS RECAP", columns))
self._display.display(tasktime(self))
self._display.display(filled("", fchar="="))
self._display.display(filled("", columns, fchar="="))
timestamp(self)
self.current = None
@@ -234,7 +301,15 @@ class CallbackModule(CallbackBase):
# Print the timings
for uuid, result in results:
msg = u"{0:-<{2}}{1:->9}".format(result['name'] + u' ', u' {0:.02f}s'.format(result['elapsed']), self._display.columns - 9)
msg = format_timing_row(
result['name'],
result['elapsed'],
columns,
truncate=self.truncate_task_names,
)
if 'path' in result:
msg += u"\n{0:-<{1}}".format(result['path'] + u' ', self._display.columns)
path_name = result['path']
if self.truncate_task_names:
path_name = truncate_name(path_name, line_width - 1)
msg += u"\n%s" % pad_to_display_width(path_name + u' ', line_width)
self._display.display(msg)
+7 -5
View File
@@ -12,9 +12,12 @@ __metaclass__ = type
DOCUMENTATION = r'''
---
module: sysctl
short_description: Manage entries in sysctl.conf.
short_description: Manage sysctl entries
description:
- This module manipulates sysctl entries and optionally performs a C(/sbin/sysctl -p) after changing them.
- If you are using C(systemd-sysctl(8)), note that it won't use the file C(/etc/sysctl.conf).
- If you are using C(procps) sysctl, it reads C(/etc/sysctl.conf).
- Read more about L(sysctl.conf, https://www.man7.org/linux/man-pages/man5/sysctl.conf.5.html).
version_added: "1.0.0"
options:
name:
@@ -41,15 +44,14 @@ options:
default: false
reload:
description:
- If V(true), performs a C(/sbin/sysctl -p) if the O(sysctl_file) is
updated. If V(false), does not reload C(sysctl) even if the
O(sysctl_file) is updated.
- If V(true), performs a C(/sbin/sysctl -p) if the O(sysctl_file) is updated.
- If V(false), does not reload C(sysctl) even if the O(sysctl_file) is updated.
- For FreeBSD, can not be used with O(sysctl_file) other than C(/etc/sysctl.conf) or C(/etc/sysctl.conf.local).
type: bool
default: true
sysctl_file:
description:
- Specifies the absolute path to C(sysctl.conf), if not C(/etc/sysctl.conf).
- Specifies the absolute path to sysctl file, if not C(/etc/sysctl.conf).
default: /etc/sysctl.conf
type: path
sysctl_set:
@@ -0,0 +1,109 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.ansible.posix.tests.unit.compat import unittest
from ansible.utils.display import get_text_width
from ansible_collections.ansible.posix.plugins.callback.profile_tasks import (
filled,
format_timing_row,
pad_to_display_width,
truncate_name,
)
class ProfileTasksDisplayTestCase(unittest.TestCase):
COLUMNS = 79
LINE_WIDTH = COLUMNS + 1
# Reproducer from https://github.com/ansible-collections/ansible.posix/pull/773#issuecomment-5325694910
MAINTAINER_ASCII_LONG = (
'012345678901234567890123456789012345678901234567890'
'12345678901234567890123456789'
)
MAINTAINER_CJK_LONG = (
'零一二三四五六七八九零一二三四五六七八九'
'零一二三四五六七八九零一二三四五六七八九'
)
ASCII_LONG = MAINTAINER_ASCII_LONG
CJK_LONG = MAINTAINER_CJK_LONG
def test_filled_banner_matches_display_width(self):
line = filled('TASKS RECAP', self.COLUMNS)
self.assertEqual(get_text_width(line), self.LINE_WIDTH)
self.assertTrue(line.endswith('*'))
def test_filled_separator_matches_display_width(self):
line = filled('', self.COLUMNS, fchar='=')
self.assertEqual(get_text_width(line), self.LINE_WIDTH)
self.assertEqual(line, '=' * self.LINE_WIDTH)
def test_truncate_name_shortens_ascii_to_display_width(self):
truncated = truncate_name(self.ASCII_LONG, 71)
self.assertLessEqual(get_text_width(truncated), 71)
self.assertTrue(truncated.endswith('...'))
def test_truncate_name_shortens_cjk_to_display_width(self):
truncated = truncate_name(self.CJK_LONG, 71)
self.assertLessEqual(get_text_width(truncated), 71)
self.assertTrue(truncated.endswith('...'))
def test_truncate_name_leaves_short_names_unchanged(self):
short = 'Short task'
self.assertEqual(truncate_name(short, 71), short)
self.assertEqual(truncate_name(self.CJK_LONG[:5], 71), self.CJK_LONG[:5])
def test_format_timing_row_ascii_fits_terminal_width(self):
row = format_timing_row(self.ASCII_LONG, 0.01, self.COLUMNS, truncate=True)
self.assertEqual(get_text_width(row), self.LINE_WIDTH)
self.assertIn('0.01s', row)
def test_format_timing_row_cjk_fits_terminal_width(self):
row = format_timing_row(self.CJK_LONG, 0.01, self.COLUMNS, truncate=True)
self.assertEqual(get_text_width(row), self.LINE_WIDTH)
self.assertIn('0.01s', row)
def test_maintainer_cjk_reproducer_fits_under_len_budget_but_not_display_width(self):
self.assertEqual(len(self.MAINTAINER_CJK_LONG), 40)
self.assertEqual(get_text_width(self.MAINTAINER_CJK_LONG), 80)
self.assertGreater(len(self.MAINTAINER_CJK_LONG), 0)
def test_maintainer_cjk_reproducer_truncates_with_ellipsis(self):
truncated = truncate_name(self.MAINTAINER_CJK_LONG, 71)
self.assertLessEqual(get_text_width(truncated), 71)
self.assertTrue(truncated.endswith('...'))
self.assertNotEqual(truncated, self.MAINTAINER_CJK_LONG)
def test_maintainer_ascii_and_cjk_recap_rows_match_terminal_width(self):
ascii_row = format_timing_row(
self.MAINTAINER_ASCII_LONG, 0.01, self.COLUMNS, truncate=True,
)
cjk_row = format_timing_row(
self.MAINTAINER_CJK_LONG, 0.01, self.COLUMNS, truncate=True,
)
self.assertEqual(get_text_width(ascii_row), self.LINE_WIDTH)
self.assertEqual(get_text_width(cjk_row), self.LINE_WIDTH)
self.assertIn('...', ascii_row)
self.assertIn('...', cjk_row)
def test_format_timing_row_uses_dash_padding_for_timing_field(self):
row = format_timing_row('Short task', 0.01, self.COLUMNS, truncate=True)
self.assertTrue(row.endswith('--- 0.01s'))
self.assertEqual(get_text_width(row), self.LINE_WIDTH)
def test_pad_to_display_width_handles_cjk(self):
padded = pad_to_display_width(self.MAINTAINER_CJK_LONG[:5] + u' ', 71)
self.assertEqual(get_text_width(padded), 71)
self.assertTrue(padded.endswith('-'))
def test_format_timing_row_cjk_timing_suffix_matches_ascii(self):
ascii_row = format_timing_row(self.MAINTAINER_ASCII_LONG, 0.01, self.COLUMNS, truncate=True)
cjk_row = format_timing_row(self.MAINTAINER_CJK_LONG, 0.01, self.COLUMNS, truncate=True)
self.assertTrue(ascii_row.endswith('--- 0.01s'))
self.assertTrue(cjk_row.endswith('--- 0.01s'))
self.assertNotIn('----', cjk_row)
self.assertEqual(
get_text_width(ascii_row[:ascii_row.rindex('.')]),
get_text_width(cjk_row[:cjk_row.rindex('.')]),
)