-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJKE-Development.yaml
229 lines (211 loc) · 9.36 KB
/
JKE-Development.yaml
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
heat_template_version: 2013-05-23
description: >
Created 5/24/17 by admin. For Cloud admin@Amazon
parameters:
flavor:
type: string
description: 'Flavor to be used for compute instance'
key_name:
type: string
description: 'For most clouds, the name of the key-pair to be used for the compute instance; for VMware clouds, the contents of the public SSH key for the compute instance'
availability_zone1:
type: string
description: 'Name of availability zone in which to create the instance'
default: 'nova'
network-id__for__vpc-cf3dafa9:
type: string
description: 'Generated to reference ''vpc-cf3dafa9'' network.'
default: 'vpc-cf3dafa9'
subnet_id_subnet-11b2fa3c:
type: string
description: 'Generated to reference subnet ''subnet-11b2fa3c''.'
default: 'subnet-11b2fa3c'
ucd_server_url:
type: string
description: 'The server URL for agent communication to UrbanCode Deploy. Do *not* add a trailing slash.'
default: 'https://glamdring.local:8443'
ucd_user:
type: string
description: 'The user credential for the UrbanCode Deploy server.'
default: 'PasswordIsAuthToken'
ucd_password:
type: string
description: 'The user credential for the UrbanCode Deploy server.'
hidden: true
ucd_relay_url:
type: string
description: 'The server URL for an agent relay - leave as ''None'' to enable agents to communicate with server directly.'
default: 'None'
parameter_groups:
- { label: 'Agent Parameters', parameters: [ucd_password, ucd_relay_url, ucd_server_url, ucd_user] }
- { label: 'Image Parameters', parameters: [flavor, key_name] }
- { label: 'Network Parameters', parameters: [availability_zone1, network-id__for__vpc-cf3dafa9, subnet_id_subnet-11b2fa3c] }
resources:
## REFERENCE {"vpc-cf3dafa9":{"type": "OS::Neutron::Net", "properties": {"network_id": "vpc-cf3dafa9", "external":"false", "subnets": [{"cidr":"172.31.48.0\/20","availability_zone":"us-east-1b","name":"subnet-11b2fa3c","id":"subnet-11b2fa3c"},{"cidr":"172.31.16.0\/20","availability_zone":"us-east-1d","name":"subnet-7066202b","id":"subnet-7066202b"},{"cidr":"172.31.0.0\/20","availability_zone":"us-east-1c","name":"subnet-6cd5ec25","id":"subnet-6cd5ec25"},{"cidr":"172.31.32.0\/20","availability_zone":"us-east-1e","name":"subnet-2072fd1c","id":"subnet-2072fd1c"},{"cidr":"172.31.64.0\/20","availability_zone":"us-east-1a","name":"subnet-ea770e8f","id":"subnet-ea770e8f"}] }}}
jke-development:
type: OS::Nova::Server
properties:
user_data: { get_resource: jke-development_mime }
user_data_format: RAW
networks:
- port: { get_resource: jke-development__to__vpc-cf3dafa9__port }
name: jke-development
image: "ami-b63769a1" # RHEL-7.3_HVM_GA-20161026-x86_64-1-Hourly2-GP2
flavor: { get_param: flavor }
key_name: { get_param: key_name }
availability_zone: { get_param: availability_zone1 }
metadata:
"__os_type__" : "Linux"
jke_war:
depends_on: jke_db
type: IBM::UrbanCode::SoftwareDeploy::UCD
properties:
apply_config: { get_resource: jke_war_sw_config }
server: jke-development
version: LATEST
agent_timeout: "360"
jke_war_sw_config:
type: IBM::UrbanCode::SoftwareConfig::UCD
properties:
name: "jke.war"
component_process: "deploy"
component_process_timeout: '600'
ucd_server_url: { get_param: ucd_server_url } # these should come from resource_tree
ucd_username: { get_param: ucd_user }
ucd_password: { get_param: ucd_password }
application: { get_attr: [resource_tree, application_name] }
environment_name: { get_attr: [resource_tree, environment_name] }
inputs: # component's environment property definitions
JKE_DB_HOST : "localhost"
jke_db:
depends_on: MySQL_Server
type: IBM::UrbanCode::SoftwareDeploy::UCD
properties:
apply_config: { get_resource: jke_db_sw_config }
server: jke-development
version: '2.0'
agent_timeout: "360"
jke_db_sw_config:
type: IBM::UrbanCode::SoftwareConfig::UCD
properties:
name: "jke.db"
component_process: "deploy"
component_process_timeout: '300'
ucd_server_url: { get_param: ucd_server_url } # these should come from resource_tree
ucd_username: { get_param: ucd_user }
ucd_password: { get_param: ucd_password }
application: { get_attr: [resource_tree, application_name] }
environment_name: { get_attr: [resource_tree, environment_name] }
MySQL_Server:
depends_on: WebSphere_Liberty_Profile
type: IBM::UrbanCode::SoftwareDeploy::UCD
properties:
apply_config: { get_resource: MySQL_Server_sw_config }
server: jke-development
version: LATEST
agent_timeout: "360"
MySQL_Server_sw_config:
type: IBM::UrbanCode::SoftwareConfig::UCD
properties:
name: "MySQL Server"
component_process: "deploy"
component_process_timeout: '750'
ucd_server_url: { get_param: ucd_server_url } # these should come from resource_tree
ucd_username: { get_param: ucd_user }
ucd_password: { get_param: ucd_password }
application: { get_attr: [resource_tree, application_name] }
environment_name: { get_attr: [resource_tree, environment_name] }
jke-development_mime:
type: OS::Heat::MultipartMime
properties:
parts:
- config: { get_resource: ucd_agent_install_linux }
subtype: "x-shellscript"
WebSphere_Liberty_Profile:
type: IBM::UrbanCode::SoftwareDeploy::UCD
properties:
apply_config: { get_resource: WebSphere_Liberty_Profile_sw_config }
server: jke-development
version: LATEST
agent_timeout: '750'
WebSphere_Liberty_Profile_sw_config:
type: IBM::UrbanCode::SoftwareConfig::UCD
properties:
name: "WebSphere Liberty Profile"
component_process: "deploy"
component_process_timeout: '600'
ucd_server_url: { get_param: ucd_server_url } # these should come from resource_tree
ucd_username: { get_param: ucd_user }
ucd_password: { get_param: ucd_password }
application: { get_attr: [resource_tree, application_name] }
environment_name: { get_attr: [resource_tree, environment_name] }
jke-development__to__vpc-cf3dafa9__port:
type: OS::Neutron::Port
properties:
security_groups:
- sg-05b62679
- sg-e4602998
- sg-8695b3f9 # sg-05b62679(default) sg-e4602998(launch-wizard-1) sg-8695b3f9(launch-wizard-4)
network_id: { get_param: network-id__for__vpc-cf3dafa9 }
replacement_policy: AUTO #TODO remove this if using HEAT version Icehouse!
fixed_ips:
- subnet: { get_param: subnet_id_subnet-11b2fa3c }
resource_tree:
type: IBM::UrbanCode::ResourceTree
properties:
urbancode_deploy_url: { get_param: ucd_server_url }
username: { get_param: ucd_user }
password: { get_param: ucd_password }
team_mappings:
application: JKE
base_resource_group:
ucd_agent_install_linux:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
template: |
#!/usr/bin/env bash
#ifconfig eth0 mtu 1454 ## Optionally patch the MTU
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/root/bin
arch=`uname -ms | awk '{print tolower($0)}' | tr " " "-" `
agent_archive=ibm-ucd-agent-$arch.tgz
if [ "_ucd_relay_url_" != "None" ]; then
proxy_args="--proxy _ucd_relay_url_:20080"
ucd_remote_host=_ucd_relay_url_
agent_args="-r -d"
ucd_jms_port=7916
else
proxy_args=
agent_args=
ucd_remote_host=_ucd_server_url_
ucd_jms_port=7918
fi
if ps -ef | grep -v grep | grep -q air-monitor.jar ; then
exit 0
elif [ -d /opt/ibm ]; then
exit 0
fi
if command -V apt-get && ! command -V curl; then apt-get -y install curl; fi
if command -V yum && ! command -V curl; then yum -y install curl; fi
curl $proxy_args -Lk --retry 10 --retry-delay 10 --retry-max-time 120 -o /tmp/$agent_archive -u _ucd_user_:_ucd_password_ "_ucd_server_url_/cli/version/downloadArtifacts?component=ucd-agent-$arch&version=_agent_version_&singleFilePath=$agent_archive"
tar xfz /tmp/$agent_archive -C /tmp
/tmp/ibm-ucd-agent-install/install-agent-with-options.sh -t "_agent_team_" -p $ucd_jms_port -s $ucd_remote_host $agent_args -x start -v -n _agent_name_
params:
_agent_name_:
str_replace:
template: |
"_application_name_._environment_name_"
params:
_application_name_: { get_attr: [resource_tree, application_name ] }
_environment_name_: { get_param: "OS::stack_name" }
_ucd_server_url_: { get_param: ucd_server_url }
_ucd_relay_url_: { get_param: ucd_relay_url }
_ucd_user_ : { get_param: ucd_user }
_ucd_password_ : { get_param: ucd_password }
_agent_version_ : 7.1
_agent_team_ : ""
outputs:
blueprint_url:
description: Blueprint Origin URL
value: https://lorien.local:8443/landscaper/view/projects?open=admin_d033ba0f_9d80_4201_807b_7203e0594bff-OrionContent/JKE/JKE-Development.yml