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
Add support for group variables to handlers #17978
Conversation
I don't think this is the correct fix, it seems we should not try to compile the full handler until it is time to execute and the variables are available in that context. cc @jimi-c |
@byrondover This pullrequest is waiting for your response. Please respond or the pullrequest will be closed. |
@byrondover This pullrequest is waiting for your response. Please respond or the pullrequest will be closed. |
@byrondover You have not responded to information requests in this pullrequest so we will assume it no longer affects you. If you are still interested in this, please create a new pullrequest with the requested information. |
ISSUE TYPE
COMPONENT NAME
Ansible Core
ANSIBLE VERSION
SUMMARY
Fixes #15103.
Moves
variables['groups']
assignment fromif hosts:
scope toif self._inventory:
scope, to better support task delegation within handlers (e.g. usingwith_items
orwith_inventory_hostnames
).Example role and bug fix illustrated below.
% cat roles/test_role/tasks/main.yml - name: Trigger handlers. command: true notify: test_handler
Before [Doesn't Work]
After [Works as Expected]