Skip to content

Commit

Permalink
fix: pass datacenter (#710)
Browse files Browse the repository at this point in the history
* fix: pass datacenter

* fix: add dc1 to release jobs as well

* fix: release jobs do not need that
  • Loading branch information
faiq authored Mar 2, 2023
1 parent f65d6f0 commit eb54427
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/vsphere-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.MESOSPHERECI_USER_TOKEN }}
VSPHERE_SERVER: ${{ secrets.VSPHERE_SERVER }}
VSPHERE_DATASTORE: ${{ secrets.VSPHERE_DATASTORE }}
VSPHERE_DATACENTER: dc1
7 changes: 6 additions & 1 deletion pkg/packer/manifests/vsphere/packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ variable "vsphere_username" {
default = "${env("VSPHERE_USERNAME") == "" ? env("VSPHERE_USER") : env("VSPHERE_USERNAME") }"
}

variable "vsphere_datacenter" {
type = string
default = "${env("VSPHERE_DATACENTER")}"
}

variable "ssh_bastion_host" {
type = string
default = ""
Expand Down Expand Up @@ -474,7 +479,7 @@ build {
strip_path = true
}
post-processor "shell-local" {
inline = [ "if ${var.dry_run}; then echo 'destroying VM ${local.vm_name}'; govc vm.destroy ${local.vm_name}; fi"]
inline = [ "if ${var.dry_run}; then echo 'destroying VM ${local.vm_name}'; govc vm.destroy -dc=${var.vsphere_datacenter} ${local.vm_name}; fi"]
environment_vars =[
"GOVC_URL=${var.vcenter_server}",
"GOVC_USERNAME=${var.vsphere_username}",
Expand Down

0 comments on commit eb54427

Please sign in to comment.