cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
84
Views
0
Helpful
0
Replies
Highlighted
Enthusiast

Format for Ansible Inventory File

Looking to see how others are formatting their ansible inventory files (hosts)

 

I can't seem to get the INI file formatting to work so I am working with YAML format. 

 

How do you build groups or group devices within this format? I have read the ansible documentation but do not really understand. The output doesn't read as I would expect. 

 

MacBook-Pro:ansible stevenwiliams$ cat hosts

all:

  hosts:

     cisco routers:

      hosts:

        R01:

        R02:

        R03:

        R04:

MacBook-Pro:ansible stevenwiliams$ ansible --list-hosts all

  hosts (1):

    cisco routers

MacBook-Pro:ansible stevenwiliams$

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards