blob: 98b67c4476f271b1100472d12a67883098dcd43e [file] [log] [blame]
Mike Elliott586f03b2017-09-08 12:46:15 -04001#!/bin/bash
2set -x
3
4export DEBIAN_FRONTEND=noninteractive
5
6##############################################################
7################### File provisioning ########################
8##############################################################
9
10cd /tmp
11
12
13## Adding configuration file: mount_config
14cat > /tmp/dcae-mount.conf << EOF_CONFIG
15osType: ubuntu
16volumes:
17 ephemeral:
18 uuid: ephemeral
19 size: 80
20 filesystems:
21 /opt/tools:
22 size: 80
23 type: ext4
24 mount_opts: ''
25 data:
26 uuid: cinder
27 size: 75
28 filesystems:
29 /opt/data:
30 size: 75
31 type: ext4
32 mount_opts: ''
33EOF_CONFIG
34
35
36## Adding configuration file: ecomp-nexus
37cat > /tmp/ecomp-nexus.crt << EOF_CONFIG
38-----BEGIN CERTIFICATE-----
39MIIFRTCCBC2gAwIBAgIQM/5eM8D0jY3yHTSyN5iO9zANBgkqhkiG9w0BAQsFADCB
40kDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
41A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNjA0BgNV
42BAMTLUNPTU9ETyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
43QTAeFw0xNzAzMjgwMDAwMDBaFw0xODAzMjgyMzU5NTlaMFcxITAfBgNVBAsTGERv
44bWFpbiBDb250cm9sIFZhbGlkYXRlZDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls
45ZGNhcmQxEzARBgNVBAMMCioub25hcC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IB
46DwAwggEKAoIBAQDIVo+kmG2sGaeIJy5pqP6mzlIwqYUXcFOG2fodsCPg9CEdlsBO
47IECuoPYmCqrJ/MHLfs+F+SjEoBfpJlqyrpLhVj8O/9xCp4Tda/YJ18n59uDJ7Rpq
48omqZlFCj/B4+H6+dkWCFy1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Z3TxqfgWuBf24CFp/95gki6
65vRysJh9Jf7A8JrrMGykC94Tpo6OiUehtQ+f65xtetvwsfNHVp3hsLzR5KwIMDARI
66IgXKyROodILsOXfR9qdA9klcXUSi6qvKF8wAopNuot4Ltyz8chiFKISjxqVrKnY2
67M7En/HyX0s1I
68-----END CERTIFICATE-----
69EOF_CONFIG
70
71
72## Adding configuration file: vm-cdap-cluster-cdap.properties
73cat > /tmp/vm-cdap-cluster-cdap.properties << EOF_CONFIG
74cluster.endpoint= foobar
75cluster.user= foobar
76cluster.password= foobar
77EOF_CONFIG
78
79
80## Adding configuration file: vm-cdap-cluster-console.properties
81cat > /tmp/vm-cdap-cluster-console.properties << EOF_CONFIG
82localhost.endpoint=http://localhost:1999
83localhost.user=console
84localhost.password=NTJhYWU1NzAwMzc3OTk1
85EOF_CONFIG
86
87
88## Adding configuration file: vm-cdap-cluster-gui.properties
89cat > /tmp/vm-cdap-cluster-gui.properties << EOF_CONFIG
90EOF_CONFIG
91
92
93## Adding configuration file: vm-cdap-cluster-log4j.properties
94cat > /tmp/vm-cdap-cluster-log4j.properties << EOF_CONFIG
95#log4j.debug=0
96log4j.rootLogger=warn, file
97log4j.logger.org.openecomp.ncomp=info, file
98log4j.additivity.org.openecomp.ncomp=false
99
100#log4j.logger.org.apache.http.headers=debug, file
101#log4j.logger.org.apache.http.wire=debug, file
102## uploaded logger
103log4j.logger.org.openecomp.ncomp.sirius.manager.uploaded=info, uploaded
104log4j.additivity.org.openecomp.ncomp.sirius.manager.uploaded=false
105## request logging
106log4j.logger.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=info, requests
107log4j.additivity.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=false
108## openstack polling
109log4j.logger.org.openecomp.ncomp.openstack.OpenStackUtil.polling=info, polling
110log4j.additivity.org.openecomp.ncomp.openstack.OpenStackUtil.polling=false
111log4j.appender.file=org.apache.log4j.RollingFileAppender
112log4j.appender.file.File=logs/manager.log
113log4j.appender.file.layout=org.apache.log4j.PatternLayout
114log4j.appender.file.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
115log4j.appender.file.MaxFileSize=50MB
116log4j.appender.file.MaxBackupIndex=5
117
118log4j.appender.uploaded=org.apache.log4j.RollingFileAppender
119log4j.appender.uploaded.File=logs/manager-uploaded.log
120log4j.appender.uploaded.layout=org.apache.log4j.PatternLayout
121log4j.appender.uploaded.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
122log4j.appender.uploaded.MaxFileSize=50MB
123log4j.appender.uploaded.MaxBackupIndex=5
124
125log4j.appender.requests=org.apache.log4j.RollingFileAppender
126log4j.appender.requests.File=logs/manager-requests.log
127log4j.appender.requests.layout=org.apache.log4j.PatternLayout
128log4j.appender.requests.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
129log4j.appender.requests.MaxFileSize=50MB
130log4j.appender.requests.MaxBackupIndex=5
131log4j.appender.polling=org.apache.log4j.RollingFileAppender
132log4j.appender.polling.File=logs/manager-polling.log
133log4j.appender.polling.layout=org.apache.log4j.PatternLayout
134log4j.appender.polling.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n
135log4j.appender.polling.MaxFileSize=50MB
136log4j.appender.polling.MaxBackupIndex=5
137
138### ECOMP Logging
139log4j.logger.org.openecomp.audit=info, audit
140log4j.additivity.org.openecomp.audit=false
141log4j.logger.org.openecomp.metrics=info, metrics
142log4j.additivity.org.openecomp.metrics=false
143log4j.logger.org.openecomp.error=info, error
144log4j.additivity.org.openecomp.error=false
145log4j.logger.com.att.eelf.debug=info, debug
146log4j.additivity.org.openecomp.debug=false
147log4j.appender.audit=org.apache.log4j.RollingFileAppender
148log4j.appender.audit.File=logs/audit.log
149log4j.appender.audit.layout=org.apache.log4j.PatternLayout
150log4j.appender.audit.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%5p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
151log4j.appender.audit.MaxFileSize=50MB
152log4j.appender.audit.MaxBackupIndex=5
153log4j.appender.metrics=org.apache.log4j.RollingFileAppender
154log4j.appender.metrics.File=logs/metrics.log
155log4j.appender.metrics.layout=org.apache.log4j.PatternLayout
156log4j.appender.metrics.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
157log4j.appender.metrics.MaxFileSize=50MB
158log4j.appender.metrics.MaxBackupIndex=5
159log4j.appender.error=org.apache.log4j.RollingFileAppender
160log4j.appender.error.File=logs/error.log
161log4j.appender.error.layout=org.apache.log4j.PatternLayout
162log4j.appender.error.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
163log4j.appender.error.MaxFileSize=50MB
164log4j.appender.error.MaxBackupIndex=5
165log4j.appender.debug=org.apache.log4j.RollingFileAppender
166log4j.appender.debug.File=logs/debug.log
167log4j.appender.debug.layout=org.apache.log4j.PatternLayout
168log4j.appender.debug.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n
169log4j.appender.debug.MaxFileSize=50MB
170log4j.appender.debug.MaxBackupIndex=5
171EOF_CONFIG
172
173
174## Adding configuration file: vm-cdap-cluster-manager.properties
175cat > /tmp/vm-cdap-cluster-manager.properties << EOF_CONFIG
176server.dir = data/resources
177metrics.dir = data/metrics
178properties.dir = data/properties
179server.port = 1999
180server.user.console = NTJhYWU1NzAwMzc3OTk1
181server.user.gui = MDlhZWVjZWEwMmFiOTJi
182server.user.client = YmE2OGE1N2U5NzRmMDg1
183EOF_CONFIG
184
185
186## Adding configuration file: vm-cdap-cluster-runtime.properties
187cat > /tmp/vm-cdap-cluster-runtime.properties << EOF_CONFIG
188factory.vm=org.openecomp.dcae.controller.service.servers.vm.DcaeVmFactory
189
190## Adding configuration file: monitoring-agent-gui.properties
191cat > /tmp/monitoring-agent-gui.properties << EOF_CONFIG
192EOF_CONFIG
193
194
195cat > /tmp/certificate.pkcs12.b64code << EOF_CERT
196EOF_CERT
197
198
199##############################################################
200################## Config Provisioning #######################
201##############################################################
202
203mkdir -p ~/.ssh
204touch ~/.ssh/authorized_keys
205echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBn8Ctt5hJGkTQaffuSeINeABV4viBIM4TcP14kaLiWR1LkyNY+TaUnjxODobtZa4YW1lxFtoMCfZt2A5W9ZZPM+shZr4BOj+wU+xIrzn7ezN/CQjH7c4Wh0mWteuPnJrtdpyGQ/qBI2T+xo5G/Tl++SPUvvN2D4H8vl0miEgVPR47/P7Ba6kl7Bmrf9m0VDPdS69Qr2AhgBq5Qi/fTeGZA4sfKDHHRJxkQIXYmS8R5FISRpBD7ta2NTHapRz9dC6Cw8UttEFiWFUBjN6lwF9LUOkj9MiqiTQaElKKQzMIHr0AhlgIkwBLKAJoDrGQD9GKPwKCdW3OmnODMPxJjXc3 > ~/.ssh/authorized_keys
206
207cp /tmp/ecomp-nexus.crt /usr/local/share/ca-certificates/ ; update-ca-certificates
208
209wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-core-utils/1.1.0/dcae-controller-core-utils-1.1.0-runtime.zip -P /opt/app/dcae-controller-core-utils
210
211cd /opt/app/dcae-controller-core-utils
212unzip -o dcae-controller-core-utils*.zip
213
214chown -R dcae:dcae /opt/app/dcae-controller-core-utils
215
216/opt/app/dcae-controller-core-utils/bin/fs-init.py
217
218wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-cdap-cluster-manager/1.1.0/dcae-controller-service-cdap-cluster-manager-1.1.0-runtime.zip -P /opt/app/dcae-controller-service-cdap-cluster-manager
219
220cd /opt/app/dcae-controller-service-cdap-cluster-manager
221unzip -o dcae-controller-service-cdap-cluster-manager*.zip
222
223chown -R dcae:dcae /opt/app/dcae-controller-service-cdap-cluster-manager
224
225wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-dmaap-drsub/1.1.0/dcae-controller-service-dmaap-drsub-1.1.0.pom -P /opt/app/dcae-controller-service-dmaap-drsub
226
227chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub
228
229curl -s -k -f -o /tmp/dcae-apod-cdap-small-hadoop_1.1.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.apod.cdap/deb-releases/dcae-apod-cdap-small-hadoop_1.1.0.deb
230
231curl -s -k -f -o /tmp/dcae-apod-analytics-tca_1.1.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.apod.analytics/deb-releases/dcae-apod-analytics-tca_1.1.0.deb
232
233curl -s -k -f -o /tmp/HelloWorld-3.5.1.jar http://repo1.maven.org/maven2/co/cask/cdap/HelloWorld/3.5.1/HelloWorld-3.5.1.jar
234mkdir -p /opt/app/cask-hello-world/lib
235mv /tmp/HelloWorld-3.5.1.jar /opt/app/cask-hello-world/lib
236
237find /opt -type f -exec sed -i 's/sudo//g' {} \;
238
239apt-key adv --keyserver-options --keyserver keyserver.ubuntu.com --recv 07513CAD
240wget -qO - http://repository.cask.co/ubuntu/precise/amd64/cdap/3.5/pubkey.gpg | apt-key add -
241
242wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-dmaap-drsub-manager/1.1.0/dcae-controller-service-dmaap-drsub-manager-1.1.0-runtime.zip -P /opt/app/dcae-controller-service-dmaap-drsub-manager
243
244cd /opt/app/dcae-controller-service-dmaap-drsub-manager
245unzip -o dcae-controller-service-dmaap-drsub-manager-1.1.0-runtime.zip
246
247chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub-manager
248
249mkdir /home/dcae/.ssh
250chmod og-rwx /home/dcae/.ssh
251chown -R dcae:dcae /home/dcae/.ssh
252touch /home/dcae/.ssh/authorized_keys
253chmod og-rwx /home/dcae/.ssh/authorized_keys
254chown -R dcae:dcae /home/dcae/.ssh/authorized_keys
255echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBn8Ctt5hJGkTQaffuSeINeABV4viBIM4TcP14kaLiWR1LkyNY+TaUnjxODobtZa4YW1lxFtoMCfZt2A5W9ZZPM+shZr4BOj+wU+xIrzn7ezN/CQjH7c4Wh0mWteuPnJrtdpyGQ/qBI2T+xo5G/Tl++SPUvvN2D4H8vl0miEgVPR47/P7Ba6kl7Bmrf9m0VDPdS69Qr2AhgBq5Qi/fTeGZA4sfKDHHRJxkQIXYmS8R5FISRpBD7ta2NTHapRz9dC6Cw8UttEFiWFUBjN6lwF9LUOkj9MiqiTQaElKKQzMIHr0AhlgIkwBLKAJoDrGQD9GKPwKCdW3OmnODMPxJjXc3 >> /home/dcae/.ssh/authorized_keys
256
257#bash /opt/app/dcae-cdap-small-hadoop/install.sh