Comments (11)
Hi,
For clarity did you successfully run it on a fresh Vagrant box on the first run, or did you always need to run it twice because the first time had the error?
Did you run an apt-get update
before the first run at any point in time outside this role? That's typically something that you would run on any Ansible managed server beforehand during a bootstrap process.
You can see in this CI run https://github.com/nickjj/ansible-docker/runs/1631249824?check_suite_focus=true, the playbook and role runs against Ubuntu 18.04 successfully and is also idempotent.
from ansible-docker.
Thank you for the quick response and for your work on this role.
Things have worked fine on a fresh Vagrant box. No second run needed. Given that experience I expected to see the same on real hardware. I assumed the appropriate package update was happening in the role somewhere.
I have another clean Ubuntu 18.04 hardware box I'll be running the same process against shortly. I've added an apt-get update
pretask to my playbook as you've suggested. I'll report back when I've run the process. Surely, you've identified the issue here.
Thanks again.
from ansible-docker.
No problem.
The reason apt-get update
isn't added to this role specifically is because let's say you have 8 roles that all apt install something. It ends up being a huge time sink to have each role run their own apt update and coordinating an apt cache variable across every role isn't the best pattern either (I used to do that 5ish years ago).
Plus, to bootstrap a role to run Ansible typically you're installing python3
and depending on how bare bones your distro is, sudo
, lsb-release
and other things too. All of which require running an apt update there. I handle those things in a dedicated "bootstrap" role which is the first role that runs on the system.
from ansible-docker.
Going to close this as I believe it would be fixed.
Feel free to re-open it if it doesn't after you check it out.
from ansible-docker.
pre_tasks:
- name: Run the equivalent of "apt-get update"
apt:
update_cache: true
changed_when: false
Incredibly, the very same problem occurred on the other clean Ubuntu 18.04 hardware box. I even copied your apt-get update
pre_task into my playbook verbatim, and I see that the task ran when executing Docker set up. Once again a second execution yielded successful installation and configuration.
from ansible-docker.
Which Vagrant box are you using?
from ansible-docker.
For refence it's passing on Ubuntu 18.04 in the CI run and I just spun up an Ubuntu 18.04 LTS server on DigitalOcean and AWS and in both cases it ran through successfully on the first run using this as the inventory configuration:
---
docker__registries:
- username: "[redacted]"
password: "[redacted]"
docker__default_pip_packages:
# Don't install docker-compose
- name: docker-compose
state: absent
# Ooverriding the defaults to omit the preceding requires this be explicit
- name: docker
state: present
The only thing I did prior to the run was make sure python3
is installed. I also used v2.1.0 of this role which I pushed yesterday. It sets the virtualenv interpreter on the pip install task to use python3 instead of having to explicitly set the ansible interpreter.
But I don't think the interpreter is the issue here because yours is stalling out in the Install Docker task which is before the pip install task.
Do you have any roles that might be installing Docker before this role, or are using some Vagrant box that has Docker pre-installed?
from ansible-docker.
Things have worked fine with Vagrant boxes. These errors are happening only with real world hardware boxes. I'm developing with Vagrant and deploying to real hardware. The issue is happening only on the real hardware—now two different clean boxes. The boxes are mini-PCs from System76 with Ubuntu pre-installed.
Docker is definitely not installed. These are brand new machines with only a bare minimum of set up for ssh. Python3 is installed. I am using the 2.0.0 version of the role from Galaxy.
If there's an inventory or environment dump from these machines I can provide I'm happy to do so. As far as I know they're pretty standard machines and once set up everything else has been working fine. I'm just hitting this odd package dependency issue.
I'd guess I'm missing some necessary set up step that for whatever reason isn't necessary in Vagrant or DigitalOcean contexts.
Thanks for the support. I'm at a loss on the issue, and the problem is likely not with the role given how much it's exercised elsewhere.
from ansible-docker.
After Googling your error I see this open issue from Docker: moby/moby#41792
Is your box connected to a VPN? That's one potential case based on a few upvotes in that thread.
iptables being misconfigured is another, and there's steps to maybe fix it based on https://stackoverflow.com/a/22876662 being linked in the issue a few times.
Have you also rebooted your box before attempting to install Docker? Maybe initially installing Docker kicks something off that allows it to work the 2nd time around. I don't know how System76 sets up their systems and I don't have one of their Ubuntu ISOs to test it against.
from ansible-docker.
I suppose we'll just need to leave this as an unsolved mystery.
There's no VPN involved. As part of the minimal set up before switching to Ansible I applied all available patches and rebooted. There may be some iptable issue, but all networking has been working fine otherwise.
I can't see a way to definitively recreate the problem without purchasing a new machine from the same vendor, and two machines is all we need for this particular project. I strongly suspect trying to roll things back and try again will be a fruitless exercise.
Thanks again for the help and for the role. I imagine we'll have better luck the next time we use it.
from ansible-docker.
Thanks for the report. I'm not a fan of unsolved mysteries but if it works in the end after a 2nd run that's always a plus.
from ansible-docker.
Related Issues (20)
- Support for docker.io package (in addition to ce and ee) HOT 4
- Failed : Install Docker's dependencies HOT 9
- Ubuntu 20.04 ImportError: No module named pkg_resources HOT 10
- Avoid docker login issue with X11 HOT 11
- Expected behavior for DockerHub private repositories login options? HOT 19
- Failed to import the required Python library HOT 10
- Update apt cache before installing packages HOT 1
- Add way to add additional packages to install HOT 3
- Versioning pinning not working HOT 5
- Install Python packages: Could not get output from /usr/local/bin/virtualenv --help HOT 16
- Hi; Please consider suppressing credentials output in: Manage Docker registry login credentials HOT 8
- Upgrade edge case HOT 9
- I'm thinking about no longer setting up a virtualenv, pip installing docker / docker compose and switching the docker_login module to a shell script HOT 2
- docker not installed into /usr/local/bin HOT 4
- Unable to find pip in the virtualenv HOT 8
- Error in new v2.2.0 version when using ansible 2.9.14 HOT 3
- Docker Compose V1 causes the Install Python packages step to crash HOT 3
- Error with pip on basic usage HOT 2
- Task exception at: Install Python packages HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-docker.