Having a hard time developing hosts file

25 views
Skip to first unread message

Laurent Walker

unread,
Oct 3, 2018, 10:44:22 AM10/3/18
to Ansible Project
Below is part of the yaml host file I am trying to complete. I am having issues targeting specific groups. Most work when using ios modules but then when I use aireos modules it just skips right over and says nothing was found. Am I creating this host file correctly? Is there a better way of doing this?

all:
    children:
        na:
            children:
                uscl:
                    children:
                        routers:
                            children:
                                voice:
                                wan:
                        wlc:
                            hosts:                    
                        switches:
                            children:
                                core:
                                    hosts:
                                access:
                                    hosts:
                                  
                usen:
                    children:
                        routers:
                            children:
                                voice:
                                    hosts:
                           
                                wan:
                        wlc:
                        switches:
                            children:
                                core:
                                    hosts:
                                access:
                                    hosts:
                                        

Brian Coca

unread,
Oct 3, 2018, 10:52:30 AM10/3/18
to Ansible Project
First, you don't seem to have any hosts defined, that is why nothing
can be matched, you are only creating groups.

Another thing i would point out is that 'groups are always global' so
any host or group relationship defined in one place affects the same
group, so voice/wan only need to be defined as children of routers one
time, no need to repeat it elsewhere. The 'routers' group under 'uscl'
is the same group as the one under 'usen'.





--
----------
Brian Coca

Laurent Walker

unread,
Oct 3, 2018, 11:46:00 AM10/3/18
to Ansible Project
Hi Brian,

Thank you for your quick reply. I removed the hosts when I posted it. Can you provide an example?

regards,
Vince

Laurent Walker

unread,
Oct 3, 2018, 11:52:06 AM10/3/18
to Ansible Project
If they are also global Routers > WAN/Voice how will i mark a host that is in a different region as voice and in usen or uscl. 

Brian Coca

unread,
Oct 3, 2018, 12:49:57 PM10/3/18
to Ansible Project
i'm unsure of what you are trying to do, but a host is always part of
all the groups it is defined in, the way you have it structured it
would always be part of all 4 groups involved.




--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages