Skip to content
This repository was archived by the owner on Jun 21, 2019. It is now read-only.

Commit 785f925

Browse files
committed
adding Turbonomic sample file management during deployment
1 parent 116e621 commit 785f925

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.tfstate
33
*.tfstate.backup
44
*.log
5+
*.scratch

VMware/vsphere-turbonomic-cert-vm-from-template/provider.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ variable "vsphere_resource_pool" {}
77
variable "vsphere_datastore" {}
88
variable "vsphere_folder" {}
99
variable "cert_template" {}
10+
variable "cert_template_network" {}
11+
variable "turbo_ssh_user" {}
12+
variable "turbo_ssh_pass" {}
1013

1114
# Configure the VMware vSphere Provider
1215
provider "vsphere" {

VMware/vsphere-turbonomic-cert-vm-from-template/turbonomic-cert.tf

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,45 @@ resource "vsphere_virtual_machine" "DiscoCert01" {
1616
disk {
1717
template = "${var.cert_template}"
1818
type = "thin"
19-
datastore = "${var.vsphere_cluster}"
19+
datastore = "${var.vsphere_datastore}"
2020
}
2121

22+
# Rename and replace the license and login configuration files
23+
provisioner "remote-exec" {
24+
inline = [
25+
"mv /srv/tomcat/data/config/license.config.topology /srv/tomcat/data/config/license.config.topology.original",
26+
"mv /srv/tomcat/data/config/login.config.topology /srv/tomcat/data/config/login.config.topology.original",
27+
]
28+
connection {
29+
type = "ssh"
30+
user = "${var.turbo_ssh_user}"
31+
password = "${var.turbo_ssh_pass}"
32+
}
33+
}
34+
35+
# Copies the local license file
36+
provisioner "file" {
37+
source = "files/license.config.topology.scratch"
38+
destination = "/srv/tomcat/data/config/license.config.topology"
39+
connection {
40+
type = "ssh"
41+
user = "${var.turbo_ssh_user}"
42+
password = "${var.turbo_ssh_pass}"
43+
}
44+
}
45+
46+
# Copies the local license file
47+
provisioner "file" {
48+
source = "files/login.config.topology.scratch"
49+
destination = "/srv/tomcat/data/config/login.config.topology"
50+
connection {
51+
type = "ssh"
52+
user = "${var.turbo_ssh_user}"
53+
password = "${var.turbo_ssh_pass}"
54+
}
55+
}
56+
}
57+
58+
output "address_DiscoCert01" {
59+
value = "${vsphere_virtual_machine.DiscoCert01.network_interface.0.ipv4_address}"
2260
}

0 commit comments

Comments
 (0)