Hi all.
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.