Skip to content

dynamic and static include in restart_galaxy.yml handler #43

@mtangaro

Description

@mtangaro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions