jcalazan / ansible-django-stack

Ansible Playbook for setting up a Django app with Nginx, Gunicorn, PostgreSQL, Celery, RabbitMQ, Supervisor, Virtualenv, and Memcached. A Vagrantfile for provisioning a VirtualBox virtual machine is included as well.
MIT License
1.37k stars 392 forks source link

Install deadsnakes team new Python Versions PPA fails #154

Open banagale opened 4 years ago

banagale commented 4 years ago

When running vagrant up

TASK [web : Add deadsnakes team New Python Versions PPA to the apt sources list] ***
task path: .../ansible-django-stack/roles/web/tasks/install_additional_packages.yml:3
fatal: [my-cool-app.local]: FAILED! => {"changed": false, "msg": "apt cache update failed"}

PLAY RECAP *********************************************************************
my-cool-app.local          : ok=24   changed=0    unreachable=0    failed=1    skipped=6    rescued=0    ignored=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

This appears to be a longstanding bug in apt related to caching. Similar issue mentioned with #114.

That said I tried some workarounds and was not able to get past this error.

banagale commented 4 years ago

I was able to resolve this by:

Going into the machine: vagrant ssh Then manually installing deadsnakes:

sudo apt-get update
sudo apt-get upgrade
sudo add-apt-repository ppa:deadsnakes/ppa
exit

and then re-running the setup:

vagrant provision

I noticed there was a prompt to hit enter during the the install of deadsnakes. Not sure if this caused the error for ansible.