Skip to content

Commit

Permalink
Added Output to sanity and cleaned up README
Browse files Browse the repository at this point in the history
  • Loading branch information
Arman Keyoumarsi committed Jun 5, 2021
1 parent 8017703 commit 33419b6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ module "example-server-windowsvm-advanced" {
}
output "vmnames" {
value = "${module.example-server-windowsvm-advanced.Windows-VM}"
value = module.example-server-windowsvm-advanced.VM
}
output "vmnameswip" {
value = "${module.example-server-windowsvm-advanced.Windows-ip}"
value = module.example-server-windowsvm-advanced.ip
}
```

Expand Down
25 changes: 13 additions & 12 deletions tests/sanity/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tests/sanity/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
terraform init
terraform fmt
terraform validate
terraform apply -var-file="private.tfvars"
3 changes: 3 additions & 0 deletions tests/sanity/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform destroy -var-file=private.tfvars
rm terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl
rm -rf .terraform
11 changes: 11 additions & 0 deletions tests/sanity/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,14 @@ module "example-server-basic" {
data_disk = each.value.data_disk
}

output "DC_ID" {
value = tomap({
for k, i in module.example-server-basic : k => i.DC_ID
})
}

output "VM" {
value = tomap({
for k, i in module.example-server-basic : k => i.VM
})
}
2 changes: 0 additions & 2 deletions tests/smoke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ variable "vm" {
network = map(list(string))
vmgateway = string
dns_servers = list(string)
data_disk = map(map(string))
}))
}

Expand All @@ -30,5 +29,4 @@ module "example-server-basic" {
vmgateway = each.value.vmgateway
dc = each.value.dc
datastore = each.value.datastore #Either
data_disk = each.value.data_disk
}

0 comments on commit 33419b6

Please sign in to comment.