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

Commit

Permalink
vmware: private key variable (#1107)
Browse files Browse the repository at this point in the history
* vmware: private key variable

* modules/vmware: update  private_key description
  • Loading branch information
Aleks Saul authored and Sergiusz Urbaniak committed Jul 3, 2017
1 parent dc81aa4 commit e5757e2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Documentation/variables/vmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +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_ssh_private_key_path | SSH private key file in .pem format 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
2 changes: 1 addition & 1 deletion examples/terraform.tfvars.vmware
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ 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.
// SSH private key file in .pem format 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"`
Expand Down
2 changes: 1 addition & 1 deletion modules/vmware/node/nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "vsphere_virtual_machine" "node" {
connection {
type = "ssh"
user = "core"
private_key = "${file(var.tectonic_vmware_ssh_private_key_path != "" ? pathexpand(var.tectonic_vmware_ssh_private_key_path) : "/dev/null")}"
private_key = "${file(var.private_key != "" ? pathexpand(var.private_key) : "/dev/null")}"
}

provisioner "file" {
Expand Down
6 changes: 6 additions & 0 deletions modules/vmware/node/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ variable "kubeconfig" {
description = "Contents of Kubeconfig"
}

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

variable "image_re" {
description = <<EOF
(internal) Regular expression used to extract repo and tag components from image strings
Expand Down
2 changes: 2 additions & 0 deletions platforms/vmware/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module "masters" {
vm_disk_template_folder = "${var.tectonic_vmware_vm_template_folder}"
vmware_folder = "${vsphere_folder.tectonic_vsphere_folder.path}"
kubeconfig = "${module.bootkube.kubeconfig}"
private_key = "${var.tectonic_vmware_ssh_private_key_path}"
image_re = "${var.tectonic_image_re}"
}

Expand Down Expand Up @@ -92,5 +93,6 @@ module "workers" {
vm_disk_template_folder = "${var.tectonic_vmware_vm_template_folder}"
vmware_folder = "${vsphere_folder.tectonic_vsphere_folder.path}"
kubeconfig = "${module.bootkube.kubeconfig}"
private_key = "${var.tectonic_vmware_ssh_private_key_path}"
image_re = "${var.tectonic_image_re}"
}
2 changes: 1 addition & 1 deletion platforms/vmware/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ variable "tectonic_vmware_ssh_authorized_key" {

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."
description = "SSH private key file in .pem format corresponding to tectonic_vmware_ssh_authorized_key. If not provided, SSH agent will be used."
default = ""
}

Expand Down

0 comments on commit e5757e2

Please sign in to comment.