Hi all.

I'm investigatin the dynamic inventory script "vmware_inventory.py (this 
one 
https://github.com/ansible/ansible/blob/devel/contrib/inventory/vmware_inventory.py)
I'd like to know how can i use _meta vars or other facts to use group_by to 
apply a role or run some action on it.
In _meta it looks like this

"_meta": {
    "hostvars": {
      "server": {
        "resourcepool": {
          "_moId": "resgroup-13971", 
          "name": "myresourcepool"
        }, 

for instance
---
- name: test
  tasks:
  - name: group the servers
    group_by: key = _meta.hostvars.*(or something to pick all the hosts).
resourcepool.myresourcepool

I'm new to JSON and dynamic inventory so if you have a better idea this 
would be welcome.
The example with resource pool is just an example - i'd like to have 
ability to create ad hoc group based on other machine settings.



-- 
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/3e06fdb1-4f0a-4812-a15e-829362e9d31f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to