mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
* apk: fix packages return value for apk-tools >= 3 (fix #11264) * Add changelog fragment
This commit is contained in:
parent
ac37544c53
commit
d424907172
3 changed files with 12 additions and 2 deletions
3
changelogs/fragments/11265-fix-apk-3.yml
Normal file
3
changelogs/fragments/11265-fix-apk-3.yml
Normal 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).
|
||||||
|
|
@ -174,7 +174,7 @@ from ansible.module_utils.basic import AnsibleModule
|
||||||
def parse_for_packages(stdout):
|
def parse_for_packages(stdout):
|
||||||
packages = []
|
packages = []
|
||||||
data = stdout.split("\n")
|
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:
|
for l in data:
|
||||||
p = regex.search(l)
|
p = regex.search(l)
|
||||||
if p:
|
if p:
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,13 @@
|
||||||
- less
|
- less
|
||||||
- nano
|
- nano
|
||||||
- vim
|
- vim
|
||||||
|
- bash
|
||||||
|
- bash-completion
|
||||||
|
- bash-completion-doc
|
||||||
|
- zsh
|
||||||
|
- zsh-calendar
|
||||||
|
- zsh-completions
|
||||||
|
- zsh-doc
|
||||||
state: present
|
state: present
|
||||||
register: results
|
register: results
|
||||||
|
|
||||||
|
|
@ -96,7 +103,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- results is changed
|
- results is changed
|
||||||
- (results.packages | length) >= 3
|
- (results.packages | length) >= 10
|
||||||
|
|
||||||
- name: Install a bunch of packages again
|
- name: Install a bunch of packages again
|
||||||
community.general.apk:
|
community.general.apk:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue