This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
forked from thomashashi/thomas_cc_demo
-
Notifications
You must be signed in to change notification settings - Fork 16
/
consul_server_oss.json
73 lines (73 loc) · 2.8 KB
/
consul_server_oss.json
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
72
73
{
"variables": {
"gcp_account_file": "{{ env `GCP_ACCOUNT_FILE_JSON`}}",
"gcp_project_id": "{{ env `GCP_PROJECT_ID` }}",
"gcp_zone": "{{ env `GCP_ZONE` }}",
"aws_access_key": "{{ env `AWS_ACCESS_KEY` }}",
"aws_secret_key": "{{ env `AWS_SECRET_KEY` }}",
"aws_region": "{{ env `AWS_REGION` }}",
"role": "consul-server",
"ami_owner": "{{ env `AMI_OWNER` }}",
"ami_prefix": "{{ env `AMI_PREFIX` }}",
"owner_tag": "{{ env `OWNER_TAG` }}",
"proj_suffix_tag": "{{ env `PROJ_SUFFIX` }}",
"type": "server",
"consul_version": "{{ env `CONSUL_VER` }}",
"build_date": "{{ env `BUILD_DATE` }}"
},
"builders": [{
"image_name": "{{ user `ami_prefix` }}-consul-{{ user `type` }}",
"type": "googlecompute",
"account_file": "{{ user `gcp_account_file` }}",
"project_id": "{{ user `gcp_project_id` }}",
"source_image": "{{ user `ami_prefix` }}-consul-base",
"ssh_username": "ubuntu",
"machine_type": "n1-standard-1",
"zone": "{{ user `gcp_zone` }}",
"tags": ["{{ user `role` }}"]
},
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_region`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "{{ user `ami_prefix` }}-consul-client-*",
"root-device-type": "ebs"
},
"owners": ["{{ user `ami_owner` }}"],
"most_recent": true
},
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "{{ user `ami_prefix` }}-consul-server-{{ user `build_date` }}",
"tags": {
"Name": "Consul Demo Ubuntu Consul Server",
"owner": "{{ user `owner_tag` }}",
"project": "Consul Demo {{ user `proj_suffix_tag` }}",
"Base_AMI_Name": "{{ .SourceAMIName }}",
"Base_AMI": "{{ .SourceAMI }}",
"consul_version": "{{ user `consul_version` }}",
"role": "{{ user `role` }}"
}
}
],
"provisioners": [{
"type": "file",
"source": "files/server-oss.hcl",
"destination": "/tmp/server.hcl"
},
{
"type": "shell",
"inline": [
"sleep 15",
"sudo mv /tmp/server.hcl /etc/consul/server.hcl",
"sudo systemctl daemon-reload",
"sudo systemctl enable consul.service",
"sudo rm -rf /opt/consul/*"
]
}
]
}