diff options
| author | jerome <jerome@xlinfo.fr> | 2025-03-25 12:31:24 +0100 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2025-03-25 12:31:24 +0100 |
| commit | 74bdaf49a5b05666d2199138a294bbc95e348c02 (patch) | |
| tree | 3cc992b220e2a69f2b45dfb426c9ec14b02018f3 /container | |
| parent | 99ca6914e93b47d46c7a30ce4605c3c8acaba3da (diff) | |
| download | proxmox_lxc-74bdaf49a5b05666d2199138a294bbc95e348c02.tar.gz proxmox_lxc-74bdaf49a5b05666d2199138a294bbc95e348c02.zip | |
bastion SSH
Diffstat (limited to 'container')
| -rw-r--r-- | container/main.tf | 19 |
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}" - } - } |
