apt target: use 'until' when the cache is updated (#65456)

This integration target can be unstable due to network/mirror issues:

    TASK [apt : uninstall hello with apt] ***
    fatal: [testhost]: FAILED! => {
        "changed": false,
        "cmd": "apt-get update",
        "msg": "E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/source/Sources.gz File has unexpected size (354740 != 354745). Mirror sync in progress? [...]",
        "rc": 100,
        [...]
pull/65777/head
Pilou 5 years ago committed by Jill R
parent 9c30325704
commit 226bf7b227

@ -4,6 +4,8 @@
- name: install hello:{{ apt_foreign_arch }} with apt - name: install hello:{{ apt_foreign_arch }} with apt
apt: pkg=hello:{{ apt_foreign_arch }} state=present update_cache=yes apt: pkg=hello:{{ apt_foreign_arch }} state=present update_cache=yes
register: apt_result
until: apt_result is success
- name: uninstall hello:{{ apt_foreign_arch }} with apt - name: uninstall hello:{{ apt_foreign_arch }} with apt
apt: pkg=hello:{{ apt_foreign_arch }} state=absent purge=yes apt: pkg=hello:{{ apt_foreign_arch }} state=absent purge=yes

@ -88,6 +88,7 @@
- name: uninstall hello with apt - name: uninstall hello with apt
apt: pkg=hello state=absent purge=yes apt: pkg=hello state=absent purge=yes
register: apt_result register: apt_result
until: apt_result is success
- name: check hello with dpkg - name: check hello with dpkg
shell: dpkg-query -l hello shell: dpkg-query -l hello

Loading…
Cancel
Save