-
Notifications
You must be signed in to change notification settings - Fork 14
/
cloudinit.tf
56 lines (45 loc) · 1.39 KB
/
cloudinit.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
data "template_file" "os_config" {
template = "${file("${path.module}/templates/cloud_init_setup.yaml.tmpl")}"
vars {
domain_name = "${var.domain_name}"
}
}
data "template_file" "jenkins_blue_config" {
template = "${file("${path.module}/templates/jenkins_blue_setup.sh.tmpl")}"
vars {
jenkins_blue_version = "${var.jenkins_blue_version}"
ebs_volume_id = "${aws_ebs_volume.jenkins.id}"
ebs_device_name = "${var.ebs_device_name}"
aws_region = "${data.aws_region.current.name}"
}
}
data "template_file" "jenkins_green_config" {
template = "${file("${path.module}/templates/jenkins_green_setup.sh.tmpl")}"
vars {
jenkins_green_version = "${var.jenkins_green_version}"
}
}
data "template_cloudinit_config" "jenkins_blue" {
gzip = true
base64_encode = true
part {
content_type = "text/cloud-config"
content = "${data.template_file.os_config.rendered}"
}
part {
content_type = "text/x-shellscript"
content = "${data.template_file.jenkins_blue_config.rendered}"
}
}
data "template_cloudinit_config" "jenkins_green" {
gzip = true
base64_encode = true
part {
content_type = "text/cloud-config"
content = "${data.template_file.os_config.rendered}"
}
part {
content_type = "text/x-shellscript"
content = "${data.template_file.jenkins_green_config.rendered}"
}
}