-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple imports of the role don't work #95
Comments
* Chore: clean-up and upgrade action - upgrade molecule-action to 2.6.16 - fix `make shell` - remove all defaults (for atosatto.docker-swarm) * Fix: including the role multiple times did not work Related: atosatto/ansible-dockerswarm#95 * Chore: upgrade molecule image; add debug * Fix: docker python package on python2 See also docker/docker-py#2840 (comment) * Chore: type-hints, refactoring * Chore: configure flake8 Co-authored-by: Richard Wossal <richard@r-wos.org>
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 |
@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. |
* Update: use become where necessary * tmp: only add build fix (#4) * Chore: upgrade to 2.6.16 (#3) * Chore: clean-up and upgrade action - upgrade molecule-action to 2.6.16 - fix `make shell` - remove all defaults (for atosatto.docker-swarm) * Fix: including the role multiple times did not work Related: atosatto/ansible-dockerswarm#95 * Chore: upgrade molecule image; add debug * Fix: docker python package on python2 See also docker/docker-py#2840 (comment) * Chore: type-hints, refactoring * Chore: configure flake8 Co-authored-by: Richard Wossal <richard@r-wos.org> Co-authored-by: Richard Wossal <richard@r-wos.org>
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: till@f8b42b6
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.The text was updated successfully, but these errors were encountered: