mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
dnf: handle error when latest pkg not found (#39720)
* dnf: handle error when latest pkg not found * Add integration test
This commit is contained in:
parent
3c389aee73
commit
bf702e6d88
2 changed files with 21 additions and 2 deletions
|
@ -192,7 +192,7 @@
|
|||
- sharutils
|
||||
state: removed
|
||||
|
||||
- name: install non-existent rpm
|
||||
- name: install non-existent rpm
|
||||
dnf:
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
|
@ -410,3 +410,19 @@
|
|||
that:
|
||||
- "'changed' in dnf_result"
|
||||
- "'results' in dnf_result"
|
||||
|
||||
# https://github.com/ansible/ansible/issues/39704
|
||||
- name: install non-existent rpm, state=latest
|
||||
dnf:
|
||||
name: non-existent-rpm
|
||||
state: latest
|
||||
ignore_errors: yes
|
||||
register: dnf_result
|
||||
|
||||
- name: verify the result
|
||||
assert:
|
||||
that:
|
||||
- "dnf_result is failed"
|
||||
- "'non-existent-rpm' in dnf_result['failures'][0]"
|
||||
- "'no package matched' in dnf_result['failures'][0]"
|
||||
- "'Failed to install some of the specified packages' in dnf_result['msg']"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue