You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using AWX with the bastion_vars in group variables and it's not working.
After searching in the code, I found the problem.
In the "awx_get_vars" function, the "ansible_host" variable is used to identify the host and I'm not using it.
My inventory looks like that
[servers]
serv01.example.net
serv02.example.net
In the lib.py file, line 224, I changed:
# this should not happen
if not host:
return {}
with this:
# maybe ansible_host is not define
if not host:
for k, v in inv.get("_meta", {}).get("hostvars", {}).items():
if k == host_ip:
host = k
host_vars = v
break
# this should not happen
if not host_vars:
return {}
With this change, it's working.
I don't think this will break other things but I let more experienced people check that.
Thank you
The text was updated successfully, but these errors were encountered:
Hi,
I'm using AWX with the bastion_vars in group variables and it's not working.
After searching in the code, I found the problem.
In the "awx_get_vars" function, the "ansible_host" variable is used to identify the host and I'm not using it.
My inventory looks like that
[servers]
serv01.example.net
serv02.example.net
In the lib.py file, line 224, I changed:
with this:
With this change, it's working.
I don't think this will break other things but I let more experienced people check that.
Thank you
The text was updated successfully, but these errors were encountered: