Created
April 24, 2025 03:59
-
-
Save valentin2105/ccf68fb5a139f70e55492858492ea2d7 to your computer and use it in GitHub Desktop.
Revisions
-
Valentin Ouvrard created this gist
Apr 24, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ terraform { required_providers { virtualbox = { source = "terra-farm/virtualbox" version = "0.2.2-alpha.1" } } } provider "virtualbox" {} resource "virtualbox_vm" "node" { count = 2 name = format("node-%02d", count.index + 1) image = "https://app.vagrantup.com/ubuntu/boxes/jammy64/versions/20220420.0.0/providers/virtualbox.box" cpus = 2 memory = "1024 mib" #user_data = file("${path.module}/user_data") network_adapter { type = "bridged" host_interface = "enp0s31f6" } } 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) }