hi,

can you please post your code..

Regards
Naveen

On Monday, 15 February 2016 18:44:47 UTC+5:30, [email protected] wrote:
>
> This approach works for me.
> Thank you kindly ;)
>
> On Thursday, January 14, 2016 at 9:50:27 AM UTC+3, jhawkesworth wrote:
>>
>> I started work on porting my callback plugin and I'm hoping someone can 
>> help me get going.
>>
>> My old plugin used to get at a list of hosts like this (in on_start):
>>
>>     hosts = self.playbook.inventory.get_hosts()
>>
>> Then I'd loop through the hosts and fetch out host_vars for each one like 
>> this:
>>
>>    host_vars = self.play.playbook.inventory.get_variables(host.name)
>>
>>
>>
>> Is there any equivalent way of doing the above in V2?
>>
>> I've been playing with the context_demo plugin and can see it gets passed 
>> an
>>
>> ansible.playbook.Playbook object
>>
>> when I look at that it has a get_plays method, but that doesn't seem to 
>> return anything.  Looking through the Playbook code, one of the things it 
>> does is load the plugins, so its like I'm trying to get at inventory (via 
>> the playbook) before it has been initialised.
>>
>> Is there another way to get at host vars?  Or is there a different 
>> callback I can use, after the inventory has been loaded?
>>
>> Many thanks,
>>
>> Jon
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to