Question about roles, handlers, variables, and scope

96 views
Skip to first unread message

Simon Fondrie-Teitler

unread,
Jun 3, 2014, 5:16:01 PM6/3/14
to ansible...@googlegroups.com
Hi all,

In a role I have, I'm including another file in the role, and setting a variable in the include statement. Then from the included file, I'm notifying a handler in that role. Should the handler be able to access the variable in the include? Right now it does not seem to be able to. A simple example of what I'm talking about is here:

https://gist.github.com/Simonft/5c5f154249cf758157c6

Thanks,
Simon

James Cammarata

unread,
Jun 4, 2014, 10:32:39 AM6/4/14
to ansible...@googlegroups.com
As far as I can tell, variables passed in as params to includes have never been merged into the global list of variables (I've gone back to 1.3.0 to test your example). So I would consider this a bug, if you'd like to open a github issue for us so we can keep track of this.

Thanks!


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7f561389-0ca5-4130-b57d-5b115b961b97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael DeHaan

unread,
Jun 6, 2014, 8:31:02 AM6/6/14
to ansible...@googlegroups.com
So it shouldn't be merged into a global list, but should be valid only for that include.




Reply all
Reply to author
Forward
0 new messages