play.hosts works !

On Monday, April 25, 2016 at 1:17:16 PM UTC-7, Ritesh Shetty wrote:
>
> I used to have this code in ansible 1.x 
>
> def playbook_on_task_start(self, name, is_conditional):
>
>         play = getattr(self, 'play', None)
>         task = getattr(self, 'task', None)
>
>         if play is not None and task is not None:
>             for host in play._play_hosts:
>                 print host
>
>
>
> But with ansible 2.0 looks like its all changed. My aim is to get list of 
> hosts when task starts for auditing purposes
>
> Can some one please help !
>
>
>
>
>
>

-- 
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/a801852b-f928-4cf4-9fc9-5315467664a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to