This repository was archived by the owner on Jun 21, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed
VMware/vsphere-turbonomic-cert-vm-from-template Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 2
2
* .tfstate
3
3
* .tfstate.backup
4
4
* .log
5
+ * .scratch
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ variable "vsphere_resource_pool" {}
7
7
variable "vsphere_datastore" {}
8
8
variable "vsphere_folder" {}
9
9
variable "cert_template" {}
10
+ variable "cert_template_network" {}
11
+ variable "turbo_ssh_user" {}
12
+ variable "turbo_ssh_pass" {}
10
13
11
14
# Configure the VMware vSphere Provider
12
15
provider "vsphere" {
Original file line number Diff line number Diff line change @@ -16,7 +16,45 @@ resource "vsphere_virtual_machine" "DiscoCert01" {
16
16
disk {
17
17
template = " ${ var . cert_template } "
18
18
type = " thin"
19
- datastore = " ${ var . vsphere_cluster } "
19
+ datastore = " ${ var . vsphere_datastore } "
20
20
}
21
21
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 } "
22
60
}
You can’t perform that action at this time.
0 commit comments