|
|
@ -33,12 +33,64 @@
|
|
|
|
- "apt_result is success"
|
|
|
|
- "apt_result is success"
|
|
|
|
- "dpkg_result is success"
|
|
|
|
- "dpkg_result is success"
|
|
|
|
- "'1.0.1' in dpkg_result.stdout"
|
|
|
|
- "'1.0.1' in dpkg_result.stdout"
|
|
|
|
|
|
|
|
always:
|
|
|
|
|
|
|
|
- name: Clean up
|
|
|
|
|
|
|
|
apt:
|
|
|
|
|
|
|
|
name: foo
|
|
|
|
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
allow_unauthenticated: yes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/issues/30638
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/issues/35900
|
|
|
|
- name: Check if install was successful
|
|
|
|
|
|
|
|
assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- "apt_result is success"
|
|
|
|
|
|
|
|
- "dpkg_result is success"
|
|
|
|
|
|
|
|
- "'1.0.1' in dpkg_result.stdout"
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: Clean up
|
|
|
|
- name: Clean up
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
|
name: foo
|
|
|
|
name: foo
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
allow_unauthenticated: yes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/issues/35900
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: Disable ubuntu repos so system packages are not upgraded and do not change testing env
|
|
|
|
|
|
|
|
command: mv /etc/apt/sources.list /etc/apt/sources.list.backup
|
|
|
|
|
|
|
|
|
|
|
|
- name: Install foobar, installs foo as a dependency
|
|
|
|
- name: Install foobar, installs foo as a dependency
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
@ -61,14 +113,21 @@
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- "dpkg_result is failed"
|
|
|
|
- "dpkg_result is failed"
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/issues/26298
|
|
|
|
always:
|
|
|
|
- name: Clean up
|
|
|
|
- name: Clean up
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
|
name: "{{ item }}"
|
|
|
|
pkg: foo,foobar
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
with_items:
|
|
|
|
autoclean: yes
|
|
|
|
- foo
|
|
|
|
|
|
|
|
- foobar
|
|
|
|
- name: Restore ubuntu repos
|
|
|
|
|
|
|
|
command: mv /etc/apt/sources.list.backup /etc/apt/sources.list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/issues/26298
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
|
|
|
- name: Disable ubuntu repos so system packages are not upgraded and do not change testing env
|
|
|
|
|
|
|
|
command: mv /etc/apt/sources.list /etc/apt/sources.list.backup
|
|
|
|
|
|
|
|
|
|
|
|
- name: Install foobar, installs foo as a dependency
|
|
|
|
- name: Install foobar, installs foo as a dependency
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
@ -141,50 +200,54 @@
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- "autoclean_result is not changed"
|
|
|
|
- "autoclean_result is not changed"
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/issues/30638
|
|
|
|
always:
|
|
|
|
- name: Fail to install foo=1.0.1 since foo is not installed and only_upgrade is set
|
|
|
|
- name: Clean up
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
|
name: foo=1.0.1
|
|
|
|
pkg: foo,foobar
|
|
|
|
state: installed
|
|
|
|
state: absent
|
|
|
|
only_upgrade: yes
|
|
|
|
autoclean: yes
|
|
|
|
allow_unauthenticated: yes
|
|
|
|
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
register: apt_result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check that foo was not upgraded
|
|
|
|
- name: Restore ubuntu repos
|
|
|
|
assert:
|
|
|
|
command: mv /etc/apt/sources.list.backup /etc/apt/sources.list
|
|
|
|
that:
|
|
|
|
|
|
|
|
- "apt_result is not changed"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- apt:
|
|
|
|
|
|
|
|
name: foo=1.0.0
|
|
|
|
|
|
|
|
allow_unauthenticated: yes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Upgrade foo to 1.0.1
|
|
|
|
- name: Upgrades
|
|
|
|
|
|
|
|
block:
|
|
|
|
|
|
|
|
- include: "upgrade.yml aptitude_present={{ True | bool }} upgrade_type=dist force_apt_get={{ False | bool }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check if aptitude is installed
|
|
|
|
|
|
|
|
command: dpkg-query --show --showformat='${db:Status-Abbrev}' aptitude
|
|
|
|
|
|
|
|
register: aptitude_status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Remove aptitude, if installed, to test fall-back to apt-get
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
|
name: foo=1.0.1
|
|
|
|
pkg: aptitude
|
|
|
|
state: installed
|
|
|
|
state: absent
|
|
|
|
only_upgrade: yes
|
|
|
|
when:
|
|
|
|
allow_unauthenticated: yes
|
|
|
|
- aptitude_status.stdout.find('ii') != -1
|
|
|
|
register: apt_result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check install with dpkg
|
|
|
|
- include: "upgrade.yml aptitude_present={{ False | bool }} upgrade_type={{ item.upgrade_type }} force_apt_get={{ item.force_apt_get }}"
|
|
|
|
shell: dpkg-query -l foo
|
|
|
|
with_items:
|
|
|
|
register: dpkg_result
|
|
|
|
- { upgrade_type: safe, force_apt_get: False }
|
|
|
|
|
|
|
|
- { upgrade_type: full, force_apt_get: False }
|
|
|
|
|
|
|
|
- { upgrade_type: safe, force_apt_get: True }
|
|
|
|
|
|
|
|
- { upgrade_type: full, force_apt_get: True }
|
|
|
|
|
|
|
|
|
|
|
|
- name: Check if install was successful
|
|
|
|
- name: (Re-)Install aptitude, run same tests again
|
|
|
|
assert:
|
|
|
|
apt:
|
|
|
|
that:
|
|
|
|
pkg: aptitude
|
|
|
|
- "apt_result is success"
|
|
|
|
state: present
|
|
|
|
- "dpkg_result is success"
|
|
|
|
|
|
|
|
- "'1.0.1' in dpkg_result.stdout"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
always:
|
|
|
|
- include: "upgrade.yml aptitude_present={{ True | bool }} upgrade_type={{ item.upgrade_type }} force_apt_get={{ item.force_apt_get }}"
|
|
|
|
- name: Clean up
|
|
|
|
with_items:
|
|
|
|
|
|
|
|
- { upgrade_type: safe, force_apt_get: False }
|
|
|
|
|
|
|
|
- { upgrade_type: full, force_apt_get: False }
|
|
|
|
|
|
|
|
- { upgrade_type: safe, force_apt_get: True }
|
|
|
|
|
|
|
|
- { upgrade_type: full, force_apt_get: True }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Remove aptitude if not originally present
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
|
name: "{{ item }}"
|
|
|
|
pkg: aptitude
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
allow_unauthenticated: yes
|
|
|
|
when:
|
|
|
|
with_items:
|
|
|
|
- aptitude_status.stdout.find('ii') == -1
|
|
|
|
- foo
|
|
|
|
|
|
|
|
- foobar
|
|
|
|
|
|
|
|