forked from cloudfoundry/service-fabrik-boshrelease
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blueprint-manifest.yml.ejs
80 lines (78 loc) · 2.27 KB
/
blueprint-manifest.yml.ejs
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
<%= spec.header %>
update:
canaries: 0
max_in_flight: 50
canary_watch_time: 1000-100000
update_watch_time: 1000-100000
serial: false
instance_groups: &instance_groups
<%
var net;
var azs;
if (spec.multi_az_enabled){
net = spec.networks[1];
azs = '[z1, z2]';
} else {
net = spec.networks[0];
azs = '[z1]';
}
const stemcell = spec.stemcell;
const members = net.static.slice(0,1);
const properties = {};
if (!spec.previous_manifest) {
/* create scenario: pick random service instance properties */
properties.blueprint = {
admin: {
username: SecureRandom.hex(16),
password: SecureRandom.hex(16)
}
};
} else {
if(!spec.previous_manifest.instance_groups){
properties.blueprint = spec.previous_manifest.properties.blueprint;
}else{
properties.blueprint = spec.previous_manifest.instance_groups[0].jobs[0].properties;
}
}
if(!spec.preUpdateAgentResponse){
properties.blueprint.preUpdateAgentResponse = JSON.stringify(spec.previous_manifest.instance_groups[0].jobs[0].properties.preUpdateAgentResponse);
}
else{
properties.blueprint.preUpdateAgentResponse = JSON.stringify(spec.preUpdateAgentResponse);
}
if(!spec.actions){
properties.blueprint.actionResponse = JSON.stringify(spec.previous_manifest.instance_groups[0].jobs[0].properties.actionResponse);
}
else{
properties.blueprint.actionResponse = JSON.stringify(spec.actions);
}
%>
- name: blueprint
migrated_from:
- name: blueprint_z1
az: z1
instances: <%= members.length %>
networks:
- name: <%= net.name %>
static_ips: <%= JSON.stringify(members) %>
vm_type: <%= p('vm_type') %>
persistent_disk_type: <%= p('disk_type') %>
azs: <%= azs %>
stemcell: <%= stemcell.alias %>
jobs:
- name: blueprint
release: blueprint
blueprint: &blueprint
properties:
port: 8080
actionResponse: <%= properties.blueprint.actionResponse %>
preUpdateAgentResponse: <%= properties.blueprint.preUpdateAgentResponse %>
admin:
username: <%= properties.blueprint.admin.username %>
password: <%= properties.blueprint.admin.password %>
- name: broker-agent
release: blueprint
properties:
username: <%= p('agent.auth.username') %>
password: <%= p('agent.auth.password') %>
provider: <%= JSON.stringify(p('agent.provider')) %>