1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

[PR #11265/d4249071 backport][stable-12] apk: fix packages return value for apk-tools >= 3 (fix #11264) (#11272)

apk: fix packages return value for apk-tools >= 3 (fix #11264) (#11265)

* apk: fix packages return value for apk-tools >= 3 (fix #11264)

* Add changelog fragment

(cherry picked from commit d424907172)

Co-authored-by: s-hamann <10639154+s-hamann@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-12-10 13:40:05 +01:00 committed by GitHub
parent 0280b1ca5d
commit 0cff5dec9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- apk - fix ``packages`` return value for apk-tools >= 3 (Alpine 3.23) (https://github.com/ansible-collections/community.general/issues/11264).

View file

@ -174,7 +174,7 @@ from ansible.module_utils.basic import AnsibleModule
def parse_for_packages(stdout):
packages = []
data = stdout.split("\n")
regex = re.compile(r"^\(\d+/\d+\)\s+\S+\s+(\S+)")
regex = re.compile(r"^\(\s*\d+/\d+\)\s+\S+\s+(\S+)")
for l in data:
p = regex.search(l)
if p:

View file

@ -89,6 +89,13 @@
- less
- nano
- vim
- bash
- bash-completion
- bash-completion-doc
- zsh
- zsh-calendar
- zsh-completions
- zsh-doc
state: present
register: results
@ -96,7 +103,7 @@
ansible.builtin.assert:
that:
- results is changed
- (results.packages | length) >= 3
- (results.packages | length) >= 10
- name: Install a bunch of packages again
community.general.apk: