Skip to content

Commit

Permalink
support terraform 0.12 connection rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant Gongaware committed Oct 10, 2019
1 parent 23e407d commit e38fec0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ auto eth0
iface eth0 inet dhcp
EOF
connection {
type = "ssh"
user = "${self.ssh_user}"
private_key = "${self.ssh_private_key}"
host = "${self.ssh_host}"
port = "${self.ssh_port}"
}
provisioner "remote-exec" {
inline = [
"ip a"
Expand Down
13 changes: 13 additions & 0 deletions proxmox/resource_vm_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,14 @@ func resourceVmQemu() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"ssh_host": {
Type: schema.TypeString,
Computed: true,
},
"ssh_port": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -922,6 +930,11 @@ func initConnInfo(
// Done with proxmox API, end parallel and do the SSH things
pmParallelEnd(pconf)

// Optional convience attributes for provisioners
d.Set("ssh_host", sshHost)
d.Set("ssh_port", sshPort)

// This connection INFO is longer shared up to the providers :-(
d.SetConnInfo(map[string]string{
"type": "ssh",
"host": sshHost,
Expand Down

0 comments on commit e38fec0

Please sign in to comment.