A
A
Anton2019-08-23 15:54:51
Ansible
Anton, 2019-08-23 15:54:51

How do you generate ansible inventory for terraform-provider-virtualbox?

There is terraform which runs Virtualbox virtual machines.
Here is the code:

resource "virtualbox_vm" "node" {
  count     = 2
  name      = format("node-%02d", count.index + 1)
  image     = "virtualbox.box"
  cpus      = 2
  memory    = "512 mib"
  user_data = file("user_data")

  network_adapter {
    type           = "hostonly"
    host_interface = "vboxnet1"
  }
  

}

output "IPAddr" {
  value = element(virtualbox_vm.node.*.network_adapter.0.ipv4_address, 1)
}

output "IPAddr_2" {
  value = element(virtualbox_vm.node.*.network_adapter.0.ipv4_address, 2)
}

How do you generate ansible inventory for terraform-provider-virtualbox ?
If you do not generate inventory, then you are launching a separate playbook for each host?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question