I'm trying to use the file provisioner with a google_compute_instance resource and it's failing on the ssh handshake with the following error being received on each attempt:
2015/07/21 09:09:46 terraform-provisioner-file: 2015/07/21 09:09:46 connecting to TCP connection for SSH
2015/07/21 09:09:46 terraform-provisioner-file: 2015/07/21 09:09:46 handshaking with SSH
2015/07/21 09:09:47 terraform-provisioner-file: 2015/07/21 09:09:47 handshake error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
2015/07/21 09:09:47 terraform-provisioner-file: 2015/07/21 09:09:47 Retryable error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
I thought this may have been related to a bug fixed in the latest release of Terraform 0.6.1
- connection/ssh: fix issue on machines with an SSH Agent available preventing key_file from being read without explicitly setting agent = false [GH-2615]
However this does not appear to be the case so I'm assuming is wrong with my definition, the resource definition I'm using is provide below.
resource "google_compute_instance" "default" {
name = "instance-name"
machine_type = "n1-standard-2"
zone = "asia-east1-b"
tags = ["my-tag"]
disk {
image = "debian-7-wheezy-v20140814"
}
// Local SSD disk
disk {
type = "local-ssd"
scratch = true
}
network_interface {
network = "default"
access_config {
// Ephemeral IP
}
}
service_account {
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
}
provisioner "file" {
source = "provision/boostrap.sh"
destination = "/tmp/boostrap.sh"
}
provisioner "remote-exec" {
inline = ["/tmp/boostrap.sh args"]
}
}