summaryrefslogtreecommitdiff
path: root/container/main.tf
diff options
context:
space:
mode:
Diffstat (limited to 'container/main.tf')
-rw-r--r--container/main.tf19
1 files changed, 11 insertions, 8 deletions
diff --git a/container/main.tf b/container/main.tf
index f20d671..1f0933d 100644
--- a/container/main.tf
+++ b/container/main.tf
@@ -40,18 +40,26 @@ resource "proxmox_lxc" "stagiaire" {
network {
name = "eth0"
bridge = "vmbr0"
- ip = "192.168.2.${var.vmid}/24"
- gw = "192.168.2.254"
+ ip = "192.168.10.${var.vmid}/24"
+ tag = "10"
+ gw = "192.168.10.1"
}
+ nameserver = "8.8.8.8"
features {
nesting = true
}
+ provisioner "local-exec" {
+ command = "./local_script 192.168.10.${var.vmid}"
+ }
+
provisioner "remote-exec" {
connection {
type = "ssh"
- host = "192.168.2.${var.vmid}"
+ host = "192.168.10.${var.vmid}"
+ bastion_host = "pve.xlinfo.fr"
+ bastion_user = "stagiaire"
user = "root"
private_key = file("~/.ssh/id_rsa")
timeout = "5m"
@@ -60,9 +68,4 @@ resource "proxmox_lxc" "stagiaire" {
"touch terraform_ok"
]
}
-
- provisioner "local-exec" {
- command = "./local_script 192.168.2.${var.vmid}"
- }
-
}