-
Notifications
You must be signed in to change notification settings - Fork 253
Open
Labels
Description
ISSUE TYPE
- Bug Report
SOFTWARE VERSIONS
Ansible:
v2.9.12
Netbox:
v2.9.4
Collection:
v2.1.0
SUMMARY
When using the compose functionality to add a field the inventory_hostname
variable is not accessible.
Usually this is needed in cases that you want to add a field based on the inventory_hostname
mutations and this is supported by the builtin constructed plugin.
STEPS TO REPRODUCE
Add a compose field in the netbox configuration
compose:
compose_field: inventory_hostname
Then run ansible-inventory to see if the field is added to the host variables.
ansible-inventory -vvvv --host name-of-host
EXPECTED RESULTS
{
"ansible_host": "x.x.x.x",
"compose_field": "name-of-host"
"custom_fields": {},
...
}
ACTUAL RESULTS
{
"ansible_host": "x.x.x.x",
"custom_fields": {},
...
}
PROPOSED SOLUTION
If you think it's the correct approach I can open a PR with the change.
mathieu-mp