2017-05-30 22:09:43 +02:00
|
|
|
# verify that apt is handling multi-arch systems properly
|
2021-01-22 05:58:31 +01:00
|
|
|
|
|
|
|
- name: load version specific vars
|
|
|
|
include_vars: '{{ item }}'
|
|
|
|
with_first_found:
|
|
|
|
- files:
|
|
|
|
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
|
|
|
- 'default.yml'
|
|
|
|
paths: '../vars'
|
|
|
|
|
2017-05-30 22:09:43 +02:00
|
|
|
- name: add architecture {{ apt_foreign_arch }}
|
|
|
|
command: dpkg --add-architecture {{ apt_foreign_arch }}
|
|
|
|
|
2021-01-22 05:58:31 +01:00
|
|
|
- name: install {{ multiarch_test_pkg }}:{{ apt_foreign_arch }} with apt
|
|
|
|
apt: pkg={{ multiarch_test_pkg }}:{{ apt_foreign_arch }} state=present update_cache=yes
|
2019-12-12 20:45:54 +01:00
|
|
|
register: apt_result
|
|
|
|
until: apt_result is success
|
2017-05-30 22:09:43 +02:00
|
|
|
|
2021-01-22 05:58:31 +01:00
|
|
|
- name: check {{ multiarch_test_pkg }} version
|
|
|
|
shell: dpkg -s {{ multiarch_test_pkg }} | grep Version | awk '{print $2}'
|
|
|
|
register: pkg_version
|
|
|
|
|
|
|
|
- name: uninstall {{ multiarch_test_pkg }}:{{ apt_foreign_arch }} with apt
|
|
|
|
apt: pkg={{ multiarch_test_pkg }}:{{ apt_foreign_arch }} state=absent purge=yes
|
2017-05-30 22:09:43 +02:00
|
|
|
|
|
|
|
- name: install deb file
|
2021-01-22 05:58:31 +01:00
|
|
|
apt: deb="/var/cache/apt/archives/{{ multiarch_test_pkg }}_{{ pkg_version.stdout }}_{{ apt_foreign_arch }}.deb"
|
2017-05-30 22:09:43 +02:00
|
|
|
register: apt_multi_initial
|
|
|
|
|
|
|
|
- name: install deb file again
|
2021-01-22 05:58:31 +01:00
|
|
|
apt: deb="/var/cache/apt/archives/{{ multiarch_test_pkg }}_{{ pkg_version.stdout }}_{{ apt_foreign_arch }}.deb"
|
2017-05-30 22:09:43 +02:00
|
|
|
register: apt_multi_secondary
|
|
|
|
|
2021-01-22 05:58:31 +01:00
|
|
|
- name: verify installation of {{ multiarch_test_pkg }}:{{ apt_foreign_arch }}
|
2017-05-30 22:09:43 +02:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "apt_multi_initial.changed"
|
|
|
|
- "not apt_multi_secondary.changed"
|
|
|
|
|
|
|
|
- name: remove all {{ apt_foreign_arch }} packages
|
|
|
|
apt:
|
|
|
|
name: "*:{{ apt_foreign_arch }}"
|
|
|
|
state: absent
|
|
|
|
purge: yes
|
|
|
|
|
|
|
|
- name: remove {{ apt_foreign_arch }} architecture
|
|
|
|
command: dpkg --remove-architecture {{ apt_foreign_arch }}
|