mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
7850dfa9d9
commit
3922b6cc93
1 changed files with 38 additions and 0 deletions
|
@ -141,6 +141,44 @@
|
||||||
that:
|
that:
|
||||||
- "autoclean_result is not changed"
|
- "autoclean_result is not changed"
|
||||||
|
|
||||||
|
# https://github.com/ansible/ansible/issues/30638
|
||||||
|
- name: Fail to install foo=1.0.1 since foo is not installed and only_upgrade is set
|
||||||
|
apt:
|
||||||
|
name: foo=1.0.1
|
||||||
|
state: installed
|
||||||
|
only_upgrade: yes
|
||||||
|
allow_unauthenticated: yes
|
||||||
|
ignore_errors: yes
|
||||||
|
register: apt_result
|
||||||
|
|
||||||
|
- name: Check that foo was not upgraded
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "apt_result is not changed"
|
||||||
|
|
||||||
|
- apt:
|
||||||
|
name: foo=1.0.0
|
||||||
|
allow_unauthenticated: yes
|
||||||
|
|
||||||
|
- name: Upgrade foo to 1.0.1
|
||||||
|
apt:
|
||||||
|
name: foo=1.0.1
|
||||||
|
state: installed
|
||||||
|
only_upgrade: yes
|
||||||
|
allow_unauthenticated: yes
|
||||||
|
register: apt_result
|
||||||
|
|
||||||
|
- name: Check install with dpkg
|
||||||
|
shell: dpkg-query -l foo
|
||||||
|
register: dpkg_result
|
||||||
|
|
||||||
|
- name: Check if install was successful
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- "apt_result is success"
|
||||||
|
- "dpkg_result is success"
|
||||||
|
- "'1.0.1' in dpkg_result.stdout"
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Clean up
|
- name: Clean up
|
||||||
apt:
|
apt:
|
||||||
|
|
Loading…
Reference in a new issue