Giter VIP home page Giter VIP logo

Comments (11)

nickjj avatar nickjj commented on July 24, 2024

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.

mkarlesky avatar mkarlesky commented on July 24, 2024

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.

nickjj avatar nickjj commented on July 24, 2024

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.

nickjj avatar nickjj commented on July 24, 2024

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.

mkarlesky avatar mkarlesky commented on July 24, 2024
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.

nickjj avatar nickjj commented on July 24, 2024

Which Vagrant box are you using?

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

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.

mkarlesky avatar mkarlesky commented on July 24, 2024

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.

nickjj avatar nickjj commented on July 24, 2024

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.

mkarlesky avatar mkarlesky commented on July 24, 2024

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.

nickjj avatar nickjj commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.