Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data source as extra variable for host #169

Open
iMilkyWayR opened this issue Feb 23, 2025 · 0 comments
Open

Data source as extra variable for host #169

iMilkyWayR opened this issue Feb 23, 2025 · 0 comments

Comments

@iMilkyWayR
Copy link

I'm trying to use the cloud.terraform.terraform_state inventory plugin. I have an LXC container in proxmox as a resource and an IP address as a data source, it looks like configuration below.

resource "proxmox_lxc" "lxc" {
...
}

data "dns_a_record_set" "lxc_ip" {
...
}

terraform_state.yaml

plugin: cloud.terraform.terraform_state
backend_type: http
backend_config:
  address: "EDITED"
  username: "EDITED"
  password: "EDITED"
search_child_modules: true
hostnames:
  - hostname
provider_mapping:
  - provider_name: registry.terraform.io/telmate/proxmox
    types:
      - proxmox_lxc

With this configuration, I receive the correct inventory from the proxmox provider but is it possible to add an extra variable from the data source?

ANSIBLE VERSION

ansible [core 2.18.2]
  config file = /Users/imilkyway/.ansible.cfg
  configured module search path = ['/Users/imilkyway/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/11.2.0/libexec/lib/python3.13/site-packages/ansible
  ansible collection location = /Users/imilkyway/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.13.2 (main, Feb  4 2025, 14:51:09) [Clang 16.0.0 (clang-1600.0.26.6)] (/opt/homebrew/Cellar/ansible/11.2.0/libexec/bin/python)
  jinja version = 3.1.5
  libyaml = True

COLLECTION VERSION

Collection                               Version
---------------------------------------- ----------
cloud.terraform                          4.0.0-dev0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant