Answer the question
In order to leave comments, you need to log in
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)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question