How can I enumerate all the host names in the inventory that match a 
particular pattern?  For example, I would like to grab all the supervisors 
from this set.  I want to use this list to configure something in a 
configuration file.

My dynamic inventory would return something like like this:

{

  "vagrant": [

    "nimbus",

    "supervisor1",

    "supervisor2",

    "zookeeper"

  ],

  "_meta": {

    "hostvars": {

      "nimbus": {

        "ansible_ssh_host": "192.168.54.4",

        "ansible_ssh_user": "vagrant",

        "ansible_ssh_private_key_file": 
".vagrant/machines/nimbus/virtualbox/private_key"

      },

      "supervisor1": {

        "ansible_ssh_host": "192.168.54.5",

        "ansible_ssh_user": "vagrant",

        "ansible_ssh_private_key_file": 
".vagrant/machines/supervisor1/virtualbox/private_key"

      },

      "supervisor2": {

        "ansible_ssh_host": "192.168.54.6",

        "ansible_ssh_user": "vagrant",

        "ansible_ssh_private_key_file": 
".vagrant/machines/supervisor2/virtualbox/private_key"

      },

      "zookeeper": {

        "ansible_ssh_host": "192.168.54.3",

        "ansible_ssh_user": "vagrant",

        "ansible_ssh_private_key_file": 
".vagrant/machines/zookeeper/virtualbox/private_key"

      }

    }

  }

}

-- 
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/f8e9f545-bf65-43d4-ba43-61f5df33a17d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to