ansible-for-kubernetes icon indicating copy to clipboard operation
ansible-for-kubernetes copied to clipboard

Ch4 (cluster-local-vms) p79 - geerlingguy.docker role fails due to stale apt cache

Open jim-whiteside opened this issue 4 years ago • 2 comments

Failure at geerlingguy.docker : Ensure dependencies are installed.

Failed to fetch http://security.debian.org/debian-security/pool/updates/main/a/apt/apt-transport-https_1.8.2.1_all.deb 404 Not Found [IP: 151.101.62.132 80]\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

A similar issue was reported in https://github.com/geerlingguy/ansible-role-docker/pull/118 - proposed solution was "controlling apt caches in the playbook that uses the role / outside the role."

So I add the following pre_task to main.yml:

  pre_tasks:
    - name: Run "update_cache=yes" if the last one is more than 3600 seconds ago
      apt:
        update_cache: yes
        cache_valid_time: 3600

jim-whiteside avatar Mar 12 '21 14:03 jim-whiteside

@jim-whiteside - Indeed, it might be best to add that task (or something similar) to the main playbook here: https://github.com/geerlingguy/ansible-for-kubernetes/blob/master/cluster-local-vms/main.yml

I typically do that for all my playbooks, not sure why I missed that here.

geerlingguy avatar Mar 12 '21 15:03 geerlingguy

See PR #98 , thanks @jim-whiteside !

adelerhof avatar Apr 04 '21 20:04 adelerhof