Re: [ansible-project] Re: List of Ansible default variables

2015-10-09 Thread Kale Franz
Brian, This is incredibly useful info and could be helpful to add to the official documentation. Similar to the play_hosts variable, is there something like a "play_roles" variable that is an ordered list of roles for the current play? I'd like to be able to trigger certain behavior

Re: [ansible-project] Re: List of Ansible default variables

2015-09-04 Thread Brian Coca
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

Re: [ansible-project] Re: List of Ansible default variables

2015-09-04 Thread James Morgan
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

[ansible-project] Re: List of Ansible default variables

2015-09-04 Thread James Morgan
Sorry to bring this up again. Was there an answer for - current group? I appreciate that I can find the groups that are set for a host but I need to know what the current group that is being acted on. The group is defined in the playbook but I need to loop over the hosts for that group in a

Re: [ansible-project] Re: List of Ansible default variables

2015-09-04 Thread James Morgan
Yep that does indeed sound like what I need. Will give it a shot Many 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