-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub.tf
71 lines (57 loc) · 2.19 KB
/
github.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
provider "github" {
token = "${var.github_token}"
}
data "github_repository_file" "harness_delegate_template" {
provider = github
repository = "${var.harness_github_repo}"
file = "${var.harness_delegate_template}"
}
resource "local_file" "delegate_name" {
content = "${replace(data.github_repository_file.harness_delegate_template.content,"delegate_name", "${var.name}")}"
filename = "harness.yaml"
}
resource "local_file" "host" {
content = "${replace(resource.local_file.delegate_name.content,"delegate_manager_host", "${var.host}")}"
filename = "harness.yaml"
}
resource "local_file" "accountId" {
content = "${replace(resource.local_file.host.content,"delegate_accountId", "${var.accountId}")}"
filename = "harness.yaml"
}
resource "local_file" "token" {
content = "${replace(resource.local_file.accountId.content,"delegate_token", "${var.token}")}"
filename = "harness.yaml"
}
resource "local_file" "replica" {
content = "${replace(resource.local_file.token.content,"delegate_replica", "${var.replica}")}"
filename = "harness.yaml"
}
resource "local_file" "tags" {
content = "${replace(resource.local_file.replica.content,"delegate_tags", "${var.tags}")}"
filename = "harness.yaml"
}
resource "local_file" "namespace" {
content = "${replace(resource.local_file.tags.content,"delegate_ns", "${var.namespace}")}"
filename = "harness.yaml"
}
resource "local_file" "image" {
content = "${replace(resource.local_file.namespace.content,"delegate_image", "${var.image}")}"
filename = "harness.yaml"
}
resource "local_file" "memory" {
content = "${replace(resource.local_file.image.content,"delegate_memory", "${var.memory}")}"
filename = "harness.yaml"
}
resource "local_file" "cpu" {
content = "${replace(resource.local_file.memory.content,"delegate_cpu", "${var.cpu}")}"
filename = "harness.yaml"
}
resource "local_file" "init_script" {
content = "${replace(resource.local_file.cpu.content,"delegate_init_script", "${var.init_script}")}"
filename = "harness.yaml"
}
resource "null_resource" "cluster-login" {
provisioner "local-exec" {
command = "kubectl apply -f harness.yaml"
}
}