Both the files are present on a localhost.. but when i am trying to reference value b = hostvars[localhost][a] into the second file into the variable b it was throwing an error "The task includes an option with an undefined variable"...
On Thursday, April 19, 2018 at 7:31:26 PM UTC+5:30, Brian Coca wrote: > > You have 2 main scopes for variables play scope and host scope. A > variable you define in play A will not be available on play B. > > You do have hostvars always available via > hostvars[<hostname>][<varname>], so even if both plays target > different hosts, you can still indirectly reference the var. > > > -- > ---------- > Brian Coca > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8299acbe-f4cd-4101-8f96-2bcd6a2c7e90%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
