-
Notifications
You must be signed in to change notification settings - Fork 38
/
consul-aws.json
165 lines (165 loc) · 5.09 KB
/
consul-aws.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{
"variables": {
"aws_access_key_id": "{{ env `AWS_ACCESS_KEY_ID` }}",
"aws_secret_access_key": "{{ env `AWS_SECRET_ACCESS_KEY` }}",
"aws_region": "{{ env `AWS_REGION` }}",
"release_version": "{{ env `RELEASE_VERSION` }}",
"vcs_name": "{{ env `VCS_NAME` }}",
"consul_version": "{{ env `CONSUL_VERSION` }}",
"consul_ent_url": "{{ env `CONSUL_ENT_URL` }}",
"consul_group": "consul",
"consul_user": "consul",
"consul_comment": "Consul",
"consul_home": "/srv/consul"
},
"builders": [
{
"name": "amazon-ebs-rhel-7.3-systemd",
"type": "amazon-ebs",
"access_key": "{{ user `aws_access_key_id` }}",
"secret_key": "{{ user `aws_secret_access_key` }}",
"region": "{{ user `aws_region` }}",
"force_deregister": true,
"force_delete_snapshot": true,
"ssh_pty": true,
"instance_type": "t2.medium",
"associate_public_ip_address": true,
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "*RHEL-7.3_HVM_GA-*",
"root-device-type": "ebs"
},
"owners": ["309956199498"],
"most_recent": true
},
"ssh_username": "ec2-user",
"ssh_timeout": "5m",
"ami_virtualization_type": "hvm",
"ami_name": "consul-image_{{ user `release_version` }}_consul_{{ user `consul_version` }}_rhel_7.3",
"ami_description": "HashiCorp Consul Image {{ user `release_version` }}",
"tags": {
"Name": "Consul RHEL 7.3 Image {{ user `release_version` }}: Consul v{{ user `consul_version` }}",
"System": "Consul",
"Product": "Consul",
"Built-By": "{{ user `vcs_name` }}",
"Release-Version": "{{ user `release_version` }}",
"Consul-Version": "{{ user `consul_version` }}",
"Vault-Version": "nil",
"Nomad-Version": "nil",
"OS": "rhel",
"OS-Version": "7.3"
}
},
{
"name": "amazon-ebs-ubuntu-16.04-systemd",
"type": "amazon-ebs",
"access_key": "{{ user `aws_access_key_id` }}",
"secret_key": "{{ user `aws_secret_access_key` }}",
"region": "{{ user `aws_region` }}",
"force_deregister": true,
"force_delete_snapshot": true,
"ssh_pty": true,
"instance_type": "t2.medium",
"associate_public_ip_address": true,
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "*ubuntu-xenial-16.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"ssh_username": "ubuntu",
"ssh_timeout": "10m",
"ami_virtualization_type": "hvm",
"ami_name": "consul-image_{{ user `release_version` }}_consul_{{ user `consul_version` }}_ubuntu_16.04",
"ami_description": "HashiCorp Consul Image {{ user `release_version` }}",
"tags": {
"Name": "Consul Ubuntu 16.04 Image {{ user `release_version` }}: Consul v{{ user `consul_version` }}",
"System": "Consul",
"Product": "Consul",
"Built-By": "{{ user `vcs_name` }}",
"Release-Version": "{{ user `release_version` }}",
"Consul-Version": "{{ user `consul_version` }}",
"Vault-Version": "nil",
"Nomad-Version": "nil",
"OS": "ubuntu",
"OS-Version": "16.04"
}
}
],
"provisioners": [
{
"type": "file",
"source": "../",
"destination": "/tmp"
},
{
"type": "shell",
"inline": [
"bash /tmp/shared/scripts/base.sh"
]
},
{
"type": "shell",
"only": ["amazon-ebs-rhel-7.3-systemd", "amazon-ebs-ubuntu-16.04-systemd"],
"inline": [
"bash /tmp/shared/scripts/base-aws.sh"
]
},
{
"type": "shell",
"environment_vars": [
"GROUP={{ user `consul_group` }}",
"USER={{ user `consul_user` }}",
"COMMENT={{ user `consul_comment` }}",
"HOME={{ user `consul_home` }}"
],
"inline": [
"bash /tmp/shared/scripts/setup-user.sh"
]
},
{
"type": "shell",
"environment_vars": [
"VERSION={{ user `consul_version` }}",
"URL={{ user `consul_ent_url` }}",
"USER={{ user `consul_user` }}",
"GROUP={{ user `consul_group` }}"
],
"inline": [
"bash /tmp/consul/scripts/install-consul.sh"
]
},
{
"type": "shell",
"only": ["amazon-ebs-rhel-7.3-systemd", "amazon-ebs-ubuntu-16.04-systemd"],
"inline": [
"bash /tmp/consul/scripts/install-consul-systemd.sh"
]
},
{
"type": "shell",
"only": ["amazon-ebs-rhel-7.3-systemd", "amazon-ebs-ubuntu-16.04-systemd"],
"inline": [
"cd /tmp/shared/scripts && bash /tmp/shared/scripts/setup-testing.sh",
"cd /tmp && rake consul:spec"
]
},
{
"type": "shell",
"only": ["amazon-ebs-rhel-7.3-systemd", "amazon-ebs-ubuntu-16.04-systemd"],
"inline": [
"bash /tmp/shared/scripts/cleanup-aws.sh"
]
},
{
"type": "shell",
"inline": [
"bash /tmp/shared/scripts/cleanup.sh"
]
}
]
}