Hi
I have a requirement to run playbook on hyperv compute nodes (windows) i tried the method mentioned to keep all variables .
ansible_ssh_user: Administrator
ansible_ssh_pass: password
ansible_ssh_port: 5986
ansible_connection: winrm
I use dynamic inventory to get the target hosts dynamically. Since the hosts are not static and they keep changing i cannot keep the above variables in a static file in group_vars
Question is can group_vars be passed as part of the dynamic inventory json ? Can i have a section in _meta as group_vars ? if yes what would be the structure ?
{
“_meta”: {
“hostvars”: {
“192.168.0.68”: {
“username”: “Administrator”,
“hypervisor_type”: “hyperv”,
“hypervisor_id_list”: [
“2”
],
“password”: “password”,
“port”: “5986”
}
}
},
“computenodes”: {
“hosts”: [
“192.168.0.68”
]
}
}