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
Currently when I use terraform-inventory I get hostvars with keys by ip address. this is a problem because it means I cannot query hostvars by hostname, and ip adresses are not known for me to query. I would normally hope to be able to use hostvars to be able to query an ip address by host name.
Is it possible to change this behaviour to be able to define the keys better in the inventory/hostvars? normally in an inventory if the ip adress was prepended with the host name it would solve it I think.
there's TF_HOSTNAME_KEY_NAME env var available. we use terraform assigned "Name" tags as hostnames, then query ansible by that hostname with TF_HOSTNAME_KEY_NAME=tags.Name exported
I am using the tag "Name" in terraform when I create all AWS instances, and they are labelled correctly in AWS, but not listed as the key for the host's ip in the inventory. Should this label as the hostname be passed through to the inventory list normally? Currently I just get ip addresses and groups created with tags.
Currently when I use terraform-inventory I get hostvars with keys by ip address. this is a problem because it means I cannot query hostvars by hostname, and ip adresses are not known for me to query. I would normally hope to be able to use hostvars to be able to query an ip address by host name.
Is it possible to change this behaviour to be able to define the keys better in the inventory/hostvars? normally in an inventory if the ip adress was prepended with the host name it would solve it I think.
ok: [localhost] => {
"hostvars": {
"13.210.124.113": {
"ami": "ami-05fdd828e5a7530b0",
"ansible_check_mode": false,
"ansible_diff_mode": false,
"ansible_facts": {},
"ansible_forks": 5,
"ansible_host": "13.210.241.143",
"ansible_inventory_sources": [
"/usr/local/bin/terraform-inventory"
],
"ansible_playbook_python": "/usr/bin/python",
"ansible_run_tags": [
"all"
],
"ansible_skip_tags": [],
"ansible_ssh_private_key_file": "~/my_key_pair.pem",
"ansible_verbosity": 0,
"ansible_version": {
"full": "2.7.8",
The text was updated successfully, but these errors were encountered: