Hi all,
I have experienced exactly the same issue as reported in these two:

https://github.com/ansible/ansible/issues/31407
https://github.com/ansible/ansible/issues/36575

In summary something like this...

- hosts: "{{ hostvars['localhost']['server_entry_from_cmdb_lookup'] }}"

...actually runs OK, but fails the linter (and therefore our pipeline)

'Using hostvars to smuggle values into play context is not recommended' - 
this was the last entry from Matt Martz <https://github.com/sivel> 

Can somebody please explain to me then how one *should* consume a variable 
containing a target host that has been gleaned from another play (i.e. a 
data access play to query a CMDB?)

The only option I have been able to consider is a '- hosts: all followed by 
delegate_to: "{{ my_target_server }}" on each task - my play has > 30 tasks 
and placing a delegate_to an all seems a bit clunky to say the least.

Can somebody please advise?

Thanks in advance...

-- 
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/bf19e270-a09a-4119-be29-7519ff4d0ff3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to