-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.tf
34 lines (31 loc) · 1.07 KB
/
data.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
# Chef provisiong attributes_json and .chef/dna.json templating
data "template_file" "attributes-json" {
template = "${file("${path.module}/files/attributes-json.tpl")}"
vars {
addons = "${join(",", split(",", "\"${var.chef_addons}\""))}"
domain = "${var.instance["domain"]}"
host = "${var.instance["hostname"]}"
license = "true"
version = "${var.chef_versions["server"]}"
}
}
# knife.rb templating
data "template_file" "knife-rb" {
template = "${file("${path.module}/files/knife-rb.tpl")}"
vars {
user = "${var.chef_user["username"]}"
fqdn = "${var.instance["hostname"]}.${var.instance["domain"]}"
org = "${var.chef_org["short"]}"
}
}
# Generate pretty output format
data "template_file" "chef-server-creds" {
template = "${file("${path.module}/files/chef-server-creds.tpl")}"
vars {
user = "${var.chef_user["username"]}"
pass = "${base64sha256(join(",", module.chef-server.id))}"
user_p = ".chef/${var.chef_user["username"]}.pem"
fqdn = "${local.public_dns}"
org = "${var.chef_org["short"]}"
}
}