Not a straight way but a roundabout way

ansible -i inventory host_group -m setup -a filter="ansible_eth0"|grep -A1 
ipv4|tail -1|cut -d: -f2|cut -d"\"" -f2

Need to check if there are different ways to extract it. 

On Wednesday, April 29, 2015 at 1:12:05 PM UTC-7, Barry Morrison wrote:
>
> Yeah, I'm aware of ansible_all_ipv4_addresses but that shows all 
> interfaces and I just want eth0. Assuming that list is eth0, eth1, etc. 
> etc. then I guess I could just take the first item in the list. 
>
> On Wednesday, April 29, 2015 at 1:06:13 PM UTC-7, Timothy Appnel wrote:
>>
>> One of the notes in the docs of the setup module reads: "the filter 
>> option filters only the first level subkey below ansible_facts." So you 
>> don't. Not that way at least. 
>>
>> What about ansible_all_ipv4_addresses? 
>
>

-- 
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/b0640856-af2e-47b9-b278-71b6402b7732%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to