This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.vagrant.tpl
120 lines (120 loc) · 4.08 KB
/
config.vagrant.tpl
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
{{ source "default.ikt" }}
{{ source "env.ikt" }}
{{ $workerSize := ref "/swarm/size/worker" }}
[
{
"Plugin": "group",
"Properties": {
"ID": "amp-manager",
"Properties": {
"Allocation": {
"LogicalIds": [
"{{ ref "/m1/ip" }}",
"{{ ref "/m2/ip" }}",
"{{ ref "/m3/ip" }}"
]
},
"Instance": {
"Plugin": "instance-vagrant",
"Properties": {
"Box": "ubuntu/xenial64"
}
},
"Flavor": {
"Plugin": "flavor-combo",
"Properties": {
"Flavors": [
{
"Plugin": "flavor-vanilla",
"Properties": {
"Init": [
"#!/bin/bash",
"apt-get install -y awscli jq"
]
}
}, {
"Plugin": "flavor-swarm/manager",
"Properties": {
"InitScriptTemplateURL": "{{ ref "/script/baseurl" }}/manager-init.vagrant.tpl",
"SwarmJoinIP": "{{ ref "/m1/ip" }}",
"Docker" : {
{{ if ref "/certificate/ca/service" }}"Host" : "tcp://{{ ref "/m1/ip" }}:{{ ref "/docker/remoteapi/tlsport" }}",
"TLS" : {
"CAFile": "{{ ref "/docker/remoteapi/cafile" }}",
"CertFile": "{{ ref "/docker/remoteapi/certfile" }}",
"KeyFile": "{{ ref "/docker/remoteapi/keyfile" }}",
"InsecureSkipVerify": false
}
{{ else }}"Host" : "tcp://{{ ref "/m1/ip" }}:{{ ref "/docker/remoteapi/port" }}"
{{ end }}
}
}
}, {
"Plugin": "flavor-vanilla",
"Properties": {
"Init": [
"set -o errexit",
"docker network inspect {{ ref "/amp/network" }} 2>&1 | grep -q 'No such network' && \\",
" docker network create -d overlay --attachable {{ ref "/amp/network" }}",
"docker service ls {{ ref "/amp/network" }} 2>&1 | grep -q 'No such network' && \\",
"docker service create --name amplifier --network {{ ref "/amp/network" }} {{ ref "/amp/amplifier/image" }}:{{ ref "/amp/amplifier/version" }} || true"
]
}
}
]
}
}
}
}
},
{
"Plugin": "group",
"Properties": {
"ID": "amp-worker",
"Properties": {
"Allocation": {
"Size": {{ $workerSize }}
},
"Instance": {
"Plugin": "instance-vagrant",
"Properties": {
"Box": "ubuntu/xenial64"
}
},
"Flavor": {
"Plugin": "flavor-combo",
"Properties": {
"Flavors": [
{
"Plugin": "flavor-vanilla",
"Properties": {
"Init": [
"#!/bin/bash",
"apt-get install -y awscli jq"
]
}
}, {
"Plugin": "flavor-swarm/worker",
"Properties": {
"InitScriptTemplateURL": "{{ ref "/script/baseurl" }}/worker-init.vagrant.tpl",
"SwarmJoinIP": "{{ ref "/m1/ip" }}",
"Docker" : {
{{ if ref "/certificate/ca/service" }}"Host" : "tcp://{{ ref "/m1/ip" }}:{{ ref "/docker/remoteapi/tlsport" }}",
"TLS" : {
"CAFile": "{{ ref "/docker/remoteapi/cafile" }}",
"CertFile": "{{ ref "/docker/remoteapi/certfile" }}",
"KeyFile": "{{ ref "/docker/remoteapi/keyfile" }}",
"InsecureSkipVerify": false
}
{{ else }}"Host" : "tcp://{{ ref "/m1/ip" }}:{{ ref "/docker/remoteapi/port" }}"
{{ end }}
}
}
}
]
}
}
}
}
}
]