Open till opened 3 years ago
Have you thought on using a different role to install docker first instead of using this one ? like for example geerlingguy/ansible-role-docker. This way you can install docker first, then the plugin and lastly then run this role with skip_engine: true
to disable the docker engine installation.
@juanluisbaptiste thanks for commenting.
We used the other role in the beginning, but it was too brittle and required way more additions. I know he's doing his best to manage a gazillion roles though, so no offence meant. :)
I really prefer using one, and I prefer to limit my exposure to random things I have to fix all around. ;)
I managed to overcome this like so:
# molecule/foo/requirements.yml
- name: atosatto.docker-swarm
- name: atosatto.docker-swarm-base
src: https://github.com/atosatto/ansible-dockerswarm.git
version: master
And then I use:
roles:
- role: atosatto.docker-swarm-base
- role: atosatto.docker-swarm
And it works.
I am using your role currently like so:
daemon.json
This is a bit of a maybe oddity, but I found no other way to insure that first Docker gets installed, so I can use
docker plugin install
and only then do I reconfiguredaemon.json
to include the plugin. If I try to configuredaemon.json
right away, the initial start of dockerd fails and therefor also the plugin install. Anyhow, I am a bit stumped.The problem: It seems no matter what I do, it the role skips certain parts and looks like the variables from the second "invocation" of your role are set. In this case, I am relying on docker-py to be installed so I can use it in my docker plugin role. In the second run, I am trying to save some time by disabling (almost) everything but the configuration of
daemon.json
.Here is an example playbook (or
prepare.yml
) with Molecule:During the first run,
skip_docker_py
is alreadytrue
:I dumped it on a local branch: https://github.com/till/ansible-dockerswarm/commit/f8b42b6a8a0d283d1d5d926d593c9d92f8d24750
I am not sure if this is a regression in Ansible as I haven't noticed this before and my test started failing only "recently". But here is my environment:
I tried adding
allow_duplicates: True
to myimport_role
statements. But to no avail. Anyhow, any thoughts? Maybe this is the wrong repository for this bug report. 🤷🏼 Any input appreciated.