Skip to content

Commit

Permalink
Merge pull request #4 from stuttgart-things/feature-3/add-agent-ssh
Browse files Browse the repository at this point in the history
added agent config
  • Loading branch information
patrick-hermann-sva authored May 5, 2024
2 parents 4f68ac8 + b757920 commit daf70b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,9 @@ variable "unverified_ssl" {
type = bool
description = "enable unverified_ssl"
}

variable "ssh_agent" {
default = false
type = bool
description = "set to false to disable using ssh-agent to authenticate."
}
4 changes: 2 additions & 2 deletions vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ resource "vsphere_virtual_machine" "vm" {
host = self.default_ip_address
user = var.vm_ssh_user
password = var.vm_ssh_password
agent = false

agent = var.ssh_agent
}
inline = var.bootstrap
}
Expand All @@ -45,6 +44,7 @@ resource "vsphere_virtual_machine" "vm" {
host = self.default_ip_address
user = var.vm_ssh_user
password = var.vm_ssh_password
agent = var.ssh_agent
}
inline = [
"sudo echo '${count.index > 0 ? "${var.vsphere_vm_name}-${count.index + 1}" : var.vsphere_vm_name}' | sudo tee /etc/hostname",
Expand Down

0 comments on commit daf70b5

Please sign in to comment.