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: commands:
- | - |
terraform -chdir=terraform plan \ 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' \ -var-file='vsphere.tfvars' -var-file='vm.tfvars' \
-input=false \ -input=false \
-out=terraform.plan -out=terraform.plan
@ -35,6 +35,8 @@ steps:
from_secret: repo_password from_secret: repo_password
ADDS_PASSWORD: ADDS_PASSWORD:
from_secret: adds_password from_secret: adds_password
VAULT_TOKEN:
from_secret: vault_token
# TF_LOG: TRACE # TF_LOG: TRACE
- name: Terraform Apply - name: Terraform Apply
image: bv11-cr01.bessems.eu/library/packer-extended 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.subnetmask" = var.dhcp_subnetmask
"dhcpconfig.gateway" = var.dhcp_gateway "dhcpconfig.gateway" = var.dhcp_gateway
"dhcpconfig.leaseduration" = var.dhcp_leaseduration "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_subnetmask" {}
variable "dhcp_gateway" {} variable "dhcp_gateway" {}
variable "dhcp_leaseduration" {} variable "dhcp_leaseduration" {}
variable "vault_api" {}
variable "vault_token" {}
variable "vault_pwpolicy" {}
variable "vault_secret" {}

View File

@ -1,13 +1,17 @@
vm_numcpu = 2 vm_numcpu = 2
vm_memory = 4096 vm_memory = 4096
adds_domainname = "srv.io" adds_domainname = "srv.io"
adds_netbiosname = "SRV" adds_netbiosname = "SRV"
adds_username = "SRV\\Administrator" adds_username = "SRV\\Administrator"
adds_ntpserver = "0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org" adds_ntpserver = "0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org"
dhcp_startip = "10.0.0.50" dhcp_startip = "10.0.0.50"
dhcp_endip = "10.0.0.250" dhcp_endip = "10.0.0.250"
dhcp_subnetmask = "255.255.255.0" dhcp_subnetmask = "255.255.255.0"
dhcp_gateway = "10.0.0.1" dhcp_gateway = "10.0.0.1"
dhcp_leaseduration = "01:00:00.00" 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_hostip = "192.168.11.200"
hv_datastore = "Datastore02.SSD" hv_datastore = "Datastore02.SSD"
hv_vmfolder = "/Terraform" hv_vmfolder = "/Terraform"
hv_network = "Isolated" hv_network = "Staging"