ansible_network_os is a reserved variable and need to be set manually.
More details can be found here
https://docs.ansible.com/ansible/devel/network/user_guide/platform_index.html

Regards,
Ganesh

On Fri, Mar 9, 2018 at 11:17 AM, Marcos Georgopoulos <m...@marcosg.com> wrote:

> Hi,
>
> There are various network modules for iOS,EOS, etc etc...
>
> What I was wondering is there a way to determine a hosts base os type so
> that the correct network module can be called? I have seen some sites
> reference 'ansible_network_os'
>
> like below. However I am not sure is this is simple a variable that has
> been set manually of something ansible sets when initially connecting to a
> device?
>
> eos_facts:
>   when: ansible_network_os == 'eos'
>
> - name: Gather facts (ops)
>   ios_facts:
>   when: ansible_network_os == 'ios'
>
> - name: Gather facts (vyos)
>   vyos_facts:
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/54f1f07f-cefd-474f-950b-7cf181573e7e%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/54f1f07f-cefd-474f-950b-7cf181573e7e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2B6y2sGsPcFu9AJs5q%2BuyUuVsg_PUQhM1LFx9AovqTcVNQxdRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to