Skip to content
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

dynamic and static include in restart_galaxy.yml handler #43

Open
mtangaro opened this issue Apr 5, 2017 · 1 comment
Open

dynamic and static include in restart_galaxy.yml handler #43

mtangaro opened this issue Apr 5, 2017 · 1 comment

Comments

@mtangaro
Copy link
Member

mtangaro commented Apr 5, 2017

Dear experts,
I've a problem with the handlers/restart_galaxy.yml task, triggered by the notify option, which is ignoring the when conditional.
I'm using supervisor, so this is leading to 2 errors (one for docker restart, one for run.sh restart), since all three tasks are triggered.

This is, likely, due to the new ansible default config:
http://docs.ansible.com/ansible/playbooks_roles.html#dynamic-versus-static-includes
In particular I'm referring to this:
"You cannot use notify to trigger a handler name which comes from a dynamic include."

For this reason all the when condition in handlers/restart_galaxy.yml are ignored.

I tested the "static=no" condition in restart_galaxy.yml, for each include and solve the problem.
Moving all when condition from restart_galaxy.yml to the corresponding tasks
restart_galaxy_docker.yml
restart_galaxy_run_sh.yml
restart_galaxy_supervisor.yml
works too.
Both of them are not so elegant solutions...
Finally, using "static=no" in handler/main.yml does not work, since ansible is not able to properly find the restart_galaxy.yml task.

I have it with both Ansible 2.2.2.0 and 2.2.1.0.

Any suggestion?
Thanks in advance,
Marco.

@mvdbeek
Copy link
Member

mvdbeek commented Apr 5, 2017

Yeah, this worked for a brief moment on 2.1.2.0 up to ... well I don't know when it broke.
They keep changing what's allowed /not allowed to do very fast.
I'm OK for including static=no in restart_galaxy.yml if that's working for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants