Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

vmware: add tectonic_vmware_ssh_private_key variable #995

Merged
merged 1 commit into from
Jun 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/variables/vmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This document gives an overview of variables used in the VMware platform of the
| tectonic_vmware_node_dns | DNS Server to be useddd by Virtual Machine(s) | string | - |
| tectonic_vmware_server | vCenter Server IP/FQDN | string | - |
| tectonic_vmware_ssh_authorized_key | SSH public key to use as an authorized key. Example: `"ssh-rsa AAAB3N..."` | string | - |
| tectonic_vmware_ssh_private_key_path | SSH private key file corresponding to tectonic_vmware_ssh_authorized_key. If not provided, SSH agent will be used. | string | `` |
| tectonic_vmware_sslselfsigned | Is the vCenter certificate Self-Signed? Example: `tectonic_vmware_sslselfsigned = "true"` | string | - |
| tectonic_vmware_vm_template | Virtual Machine template of CoreOS Container Linux. | string | - |
| tectonic_vmware_vm_template_folder | Folder for VM template of CoreOS Container Linux. | string | - |
Expand Down
3 changes: 3 additions & 0 deletions examples/terraform.tfvars.vmware
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ tectonic_vmware_server = ""
// SSH public key to use as an authorized key. Example: `"ssh-rsa AAAB3N..."`
tectonic_vmware_ssh_authorized_key = ""

// SSH private key file corresponding to tectonic_vmware_ssh_authorized_key. If not provided, SSH agent will be used.
tectonic_vmware_ssh_private_key_path = ""

// Is the vCenter certificate Self-Signed? Example: `tectonic_vmware_sslselfsigned = "true"`
tectonic_vmware_sslselfsigned = ""

Expand Down
5 changes: 3 additions & 2 deletions modules/vmware/node/nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ resource "vsphere_virtual_machine" "node" {
}

connection {
type = "ssh"
user = "core"
type = "ssh"
user = "core"
private_key = "${file(var.tectonic_vmware_ssh_private_key_path != "" ? pathexpand(var.tectonic_vmware_ssh_private_key_path) : "/dev/null")}"
}

provisioner "file" {
Expand Down
9 changes: 5 additions & 4 deletions platforms/vmware/remote.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ resource "null_resource" "bootstrap" {
# Without depends_on, this remote-exec may start before the kubeconfig copy. # Terraform only does one task at a time, so it would try to bootstrap # Kubernetes and Tectonic while no Kubelets are running. Ensure all nodes # receive a kubeconfig before proceeding with bootkube and tectonic. #depends_on = ["null_resource.kubeconfig-masters"]

connection {
type = "ssh"
host = "${module.masters.ip_address[0]}"
user = "core"
timeout = "60m"
type = "ssh"
host = "${module.masters.ip_address[0]}"
user = "core"
timeout = "60m"
private_key = "${file(var.tectonic_vmware_ssh_private_key_path != "" ? pathexpand(var.tectonic_vmware_ssh_private_key_path) : "/dev/null")}"
}

provisioner "file" {
Expand Down
6 changes: 6 additions & 0 deletions platforms/vmware/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ variable "tectonic_vmware_ssh_authorized_key" {
description = "SSH public key to use as an authorized key. Example: `\"ssh-rsa AAAB3N...\"`"
}

variable "tectonic_vmware_ssh_private_key_path" {
type = "string"
description = "SSH private key file corresponding to tectonic_vmware_ssh_authorized_key. If not provided, SSH agent will be used."
default = ""
}

variable "tectonic_vmware_node_dns" {
type = "string"
description = "DNS Server to be useddd by Virtual Machine(s)"
Expand Down