File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,15 @@ resource "libvirt_domain" "virt-machine" {
7676 " date"
7777 ]
7878 connection {
79- type = " ssh"
80- user = var. ssh_admin
81- host = var. ssh_host_override != null ? var. ssh_host_override : self. network_interface . 0 . addresses . 0
82- port = var. ssh_port_override
83- private_key = var. ssh_private_key != null ? file (var. ssh_private_key ) : null
79+ type = " ssh"
80+ user = var. ssh_admin
81+ host = var. ssh_host_override != null ? var. ssh_host_override : self. network_interface . 0 . addresses . 0
82+ port = var. ssh_port_override
83+ private_key = var. ssh_private_key != null ? file (var. ssh_private_key ) : null
84+ bastion_host = try (var. ssh_bastion_connect [" host" ], " " ) != " " ? var. ssh_bastion_connect [" host" ] : null
85+ bastion_user = try (var. ssh_bastion_connect [" user" ], " " ) != " " ? var. ssh_bastion_connect [" user" ] : null
86+ bastion_port = try (var. ssh_bastion_connect [" port" ], " " ) != " " ? var. ssh_bastion_connect [" port" ] : null
87+ bastion_private_key = try (var. ssh_bastion_connect [" privkey" ], null ) != null ? var. ssh_bastion_connect [" privkey" ] : null
8488 timeout = " 2m"
8589 }
8690 }
Original file line number Diff line number Diff line change @@ -177,6 +177,16 @@ variable "ssh_port_override" {
177177 default = 22
178178}
179179
180+ variable "ssh_bastion_connect" {
181+ description = " Use a bastion host to connect through"
182+ default = {
183+ host = " "
184+ port = " 22"
185+ user = " root"
186+ passwd = " "
187+ privkey = null
188+ }
189+ }
180190
181191variable "runcmd" {
182192 description = " Extra commands to be run with cloud init"
You can’t perform that action at this time.
0 commit comments