Rename network;Add new vApp properties w/ vars
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2021-03-31 09:59:33 +02:00
parent a83cc9e2f8
commit 7f01f77008
5 changed files with 30 additions and 14 deletions

View File

@ -21,7 +21,7 @@ steps:
commands:
- |
terraform -chdir=terraform plan \
-var="hv_password=$${VSPHERE_PASSWORD}" -var="repo_username=$${REPO_USERNAME}" -var="repo_password=$${REPO_PASSWORD}" -var="adds_password=$${ADDS_PASSWORD}"\
-var="hv_password=$${VSPHERE_PASSWORD}" -var="repo_username=$${REPO_USERNAME}" -var="repo_password=$${REPO_PASSWORD}" -var="adds_password=$${ADDS_PASSWORD}" -var="vault_token=$${VAULT_TOKEN}" \
-var-file='vsphere.tfvars' -var-file='vm.tfvars' \
-input=false \
-out=terraform.plan
@ -35,6 +35,8 @@ steps:
from_secret: repo_password
ADDS_PASSWORD:
from_secret: adds_password
VAULT_TOKEN:
from_secret: vault_token
# TF_LOG: TRACE
- name: Terraform Apply
image: bv11-cr01.bessems.eu/library/packer-extended

View File

@ -56,6 +56,11 @@ resource "vsphere_virtual_machine" "vm-dc" {
"dhcpconfig.subnetmask" = var.dhcp_subnetmask
"dhcpconfig.gateway" = var.dhcp_gateway
"dhcpconfig.leaseduration" = var.dhcp_leaseduration
"vault.api" = var.vault_api
"vault.token" = var.vault_token
"vault.pwpolicy" = var.vault_pwpolicy
"vault.secret" = var.vault_secret
}
}

View File

@ -27,3 +27,8 @@ variable "dhcp_endip" {}
variable "dhcp_subnetmask" {}
variable "dhcp_gateway" {}
variable "dhcp_leaseduration" {}
variable "vault_api" {}
variable "vault_token" {}
variable "vault_pwpolicy" {}
variable "vault_secret" {}

View File

@ -11,3 +11,7 @@ dhcp_endip = "10.0.0.250"
dhcp_subnetmask = "255.255.255.0"
dhcp_gateway = "10.0.0.1"
dhcp_leaseduration = "01:00:00.00"
vault_api = "https://secure.spamasaurus.com/v1"
vault_pwpolicy = "complex"
vault_secret = "SRV.IO"

View File

@ -5,4 +5,4 @@ hv_host = "bv11-esx.bessems.lan"
hv_hostip = "192.168.11.200"
hv_datastore = "Datastore02.SSD"
hv_vmfolder = "/Terraform"
hv_network = "Isolated"
hv_network = "Staging"