Skip to content

Commit 7fb35aa

Browse files
authored
Merge pull request #7 from chokhareganesh/master
after uncommenting distributed mudule in main.tf and terraform fmt
2 parents 7453a4d + 3f11612 commit 7fb35aa

File tree

6 files changed

+32
-37
lines changed

6 files changed

+32
-37
lines changed

main.tf

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,47 @@ provider "libvirt" {
33
uri = "qemu:///system"
44
}
55

6-
76
#you can only uncomment either "distributed_topology or basic_topology module" for deployment and gives specefied variable values
87

8+
99
#importing all modues from module directory
1010

11-
#uncomment for distributed techonology
12-
#module "distributed_topology" {
1311

14-
#For Distributed all node images path required.
1512

16-
#source = "modules/distributed_topology/"
17-
#proxy_img_path = "paste_proxy_image_path"
18-
#mng_img_path = "paste_management_image_path"
19-
#boot_img_path = "paste_boot_image_path"
20-
#worker_img_path = "paste_worker_image_path"
21-
#master_img_path = "paste_master_image_path"
13+
module "distributed_topology" {
14+
15+
16+
#For Distributed all node images path required.
17+
18+
19+
source = "modules/distributed_topology/"
20+
proxy_img_path = "paste_proxy_image_path"
21+
mng_img_path = "paste_management_image_path"
22+
boot_img_path = "paste_boot_image_path"
23+
worker_img_path = "paste_worker_image_path"
24+
master_img_path = "paste_master_image_path"
25+
26+
27+
ssh_private_key_path = "paste_path_of_id_rsa"
28+
default_worker = "1"
29+
extra_worker = "0"
30+
}
2231

23-
#ssh_private_key_path = "paste_path_of_id_rsa"
24-
#default_worker = "1"
25-
#extra_worker = "0"
26-
#}
2732

2833
#uncomment for basic topology
2934
#module "basic_topology" {
3035

31-
#For Basic only master_img_path and worker_img_path is required.
32-
33-
#source = "modules/basic_topology/"
34-
#worker_img_path ="paste_worker_image_path"
35-
#master_img_path ="paste_master_image_path"
3636

37-
#ssh_private_key_path = "paste_path_of_id_rsa"
38-
#default_worker = "1"
39-
#extra_worker = "0"
37+
#For Basic only master_img_path and worker_img_path is required.
38+
39+
40+
#source = "modules/basic_topology/"
41+
#worker_img_path ="paste_worker_image_path"
42+
#master_img_path ="paste_master_image_path"
43+
44+
45+
#ssh_private_key_path = "paste_path_of_id_rsa"
46+
#default_worker = "1"
47+
#extra_worker = "0"
4048
#}
49+

modules/basic_topology/worker.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@ resource "libvirt_cloudinit" "worker" {
1515
count = "${var.default_worker}"
1616
user_data = "${file("node_config/worker_config")}"
1717
local_hostname = "worker${count.index}"
18-
19-
2018
}
2119

2220
resource "libvirt_volume" "volume" {
2321
name = "volume-${count.index}"
2422
base_volume_id = "${libvirt_volume.ICP.id}"
2523
count = "${var.default_worker}"
26-
27-
2824
}
2925

3026
# Create the resource VM for worker

modules/distributed_topology/boot.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,4 @@ resource "libvirt_domain" "ICP_boot" {
111111
depends_on = [
112112
"libvirt_domain.ICP_proxy",
113113
]
114-
115114
}

modules/distributed_topology/extra_worker.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ resource "libvirt_cloudinit" "exworker" {
44
count = "${var.extra_worker}"
55
user_data = "${file("node_config/extraworker_config")}"
66
local_hostname = "exworker${count.index}"
7-
8-
97
}
108

119
resource "libvirt_volume" "exvolume" {
1210
name = "exvolume-${count.index}"
1311
base_volume_id = "${libvirt_volume.ICP.id}"
1412
count = "${var.extra_worker}"
15-
16-
1713
}
1814

1915
# Create the resource for extra worker machine
@@ -23,7 +19,6 @@ resource "libvirt_domain" "ExICPworker" {
2319
vcpu = 2
2420
count = "${var.extra_worker}"
2521

26-
2722
cloudinit = "${element(libvirt_cloudinit.exworker.*.id,count.index)}"
2823

2924
depends_on = [
@@ -110,4 +105,3 @@ resource "null_resource" "ExICPworker" {
110105
private_key = "${file("${var.ssh_private_key_path}")}"
111106
}
112107
}
113-

modules/distributed_topology/management.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,4 @@ resource "libvirt_domain" "ICP_mng" {
7979
port = "22"
8080
private_key = "${file("${var.ssh_private_key_path}")}"
8181
}
82-
8382
}
84-

modules/distributed_topology/worker.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resource "libvirt_cloudinit" "worker" {
1313
pool = "default" #CHANGE_ME if you use anohter storage pool
1414
count = "${var.default_worker}"
1515
user_data = "${file("node_config/worker_config")}"
16-
local_hostname = "worker${count.index}"
16+
local_hostname = "worker${count.index}"
1717
}
1818

1919
resource "libvirt_volume" "volume" {
@@ -89,5 +89,4 @@ resource "libvirt_domain" "ICP_worker" {
8989
depends_on = [
9090
"libvirt_domain.ICP_mng",
9191
]
92-
9392
}

0 commit comments

Comments
 (0)