You seem to want the play_hosts variable (current active hosts in current play).
On Fri, Sep 4, 2015 at 12:44 PM, James Morgan <[email protected]> wrote: > Ok thanks, > > I think I will need to pass it through from the playbook, the issue is that > on a flat deployment where every group has the same host, when I use > group_names I get all possible groups, not the one currently being handled. > > This meant that I ended up with a duplicate list of about 12 hosts. Is it > possible to append to a list in jinja. If so I could loop over groups_names, > then over the hosts in that group and build up a list of hosts then uniq the > list > > {% for group in group_names %} > {% for host in groups[group] %} > .... > > > <Location /admin> > SetHandler otas-handler > > OTASHost 172.31.5.20 19202 > > OTASHost 172.31.5.20 19202 > > OTASHost 172.31.5.20 19202 > > OTASHost 172.31.5.20 19202 > ..... > > Thanks for the consise list of the others, very useful. > > On Friday, 4 September 2015 16:46:12 UTC+1, Brian Coca wrote: >> >> current_host = inventory_hostname >> current_group = no singular, we always flatten to host, you can check >> the current host's groups in "group_names" list of the current host >> current_user = lookup('env', 'USER') ? >> current_task = nothing represents the current task .. since you are in >> the current task ..., not sure what you want here. >> current_role = role_path|basename >> >> >> -- >> 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/9aaf2756-36e6-43f1-bb5a-a8b6d6a1c076%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- 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/CAJ5XC8%3DJm-%3DLQQ9o29otUuP-K5E8iCUrEURUqc3QdRLY0C2gyg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
