Mike Elliott | 586f03b | 2017-09-08 12:46:15 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -x |
| 3 | |
| 4 | export DEBIAN_FRONTEND=noninteractive |
| 5 | |
| 6 | ############################################################## |
| 7 | ################### File provisioning ######################## |
| 8 | ############################################################## |
| 9 | |
| 10 | cd /tmp |
| 11 | |
| 12 | |
| 13 | ## Adding configuration file: mount_config |
| 14 | cat > /tmp/dcae-mount.conf << EOF_CONFIG |
| 15 | osType: ubuntu |
| 16 | volumes: |
| 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: '' |
| 33 | EOF_CONFIG |
| 34 | |
| 35 | |
| 36 | ## Adding configuration file: ecomp-nexus |
| 37 | cat > /tmp/ecomp-nexus.crt << EOF_CONFIG |
| 38 | -----BEGIN CERTIFICATE----- |
| 39 | MIIFRTCCBC2gAwIBAgIQM/5eM8D0jY3yHTSyN5iO9zANBgkqhkiG9w0BAQsFADCB |
| 40 | kDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G |
| 41 | A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNjA0BgNV |
| 42 | BAMTLUNPTU9ETyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD |
| 43 | QTAeFw0xNzAzMjgwMDAwMDBaFw0xODAzMjgyMzU5NTlaMFcxITAfBgNVBAsTGERv |
| 44 | bWFpbiBDb250cm9sIFZhbGlkYXRlZDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls |
| 45 | ZGNhcmQxEzARBgNVB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aHR0cDovL29jc3AuY29tb2RvY2EuY29tMB8GA1UdEQQYMBaC |
| 61 | Cioub25hcC5vcmeCCG9uYXAub3JnMA0GCSqGSIb3DQEBCwUAA4IBAQAd5mu22sts |
| 62 | at/bdRlIOz3dbqGwIFOo8XajlAs6ApMpyx/xetcgIKipzvGp9Wc1X8lDZl4boCH6 |
| 63 | KQ1//4tpksYj8RsZSZeac8vQLKggWO107sBa33yFg6Y1Dk2DdgOKZ+lNbvB1iMwK |
| 64 | hSGtV3HYx1jLyQRoeYby4R7+kTI1lHAiOgT+vn5C9Z3TxqfgWuBf24CFp/95gki6 |
| 65 | vRysJh9Jf7A8JrrMGykC94Tpo6OiUehtQ+f65xtetvwsfNHVp3hsLzR5KwIMDARI |
| 66 | IgXKyROodILsOXfR9qdA9klcXUSi6qvKF8wAopNuot4Ltyz8chiFKISjxqVrKnY2 |
| 67 | M7En/HyX0s1I |
| 68 | -----END CERTIFICATE----- |
| 69 | EOF_CONFIG |
| 70 | |
| 71 | |
| 72 | ## Adding configuration file: vm-cdap-cluster-cdap.properties |
| 73 | cat > /tmp/vm-cdap-cluster-cdap.properties << EOF_CONFIG |
| 74 | cluster.endpoint= foobar |
| 75 | cluster.user= foobar |
| 76 | cluster.password= foobar |
| 77 | EOF_CONFIG |
| 78 | |
| 79 | |
| 80 | ## Adding configuration file: vm-cdap-cluster-console.properties |
| 81 | cat > /tmp/vm-cdap-cluster-console.properties << EOF_CONFIG |
| 82 | localhost.endpoint=http://localhost:1999 |
| 83 | localhost.user=console |
| 84 | localhost.password=NTJhYWU1NzAwMzc3OTk1 |
| 85 | EOF_CONFIG |
| 86 | |
| 87 | |
| 88 | ## Adding configuration file: vm-cdap-cluster-gui.properties |
| 89 | cat > /tmp/vm-cdap-cluster-gui.properties << EOF_CONFIG |
| 90 | EOF_CONFIG |
| 91 | |
| 92 | |
| 93 | ## Adding configuration file: vm-cdap-cluster-log4j.properties |
| 94 | cat > /tmp/vm-cdap-cluster-log4j.properties << EOF_CONFIG |
| 95 | #log4j.debug=0 |
| 96 | log4j.rootLogger=warn, file |
| 97 | log4j.logger.org.openecomp.ncomp=info, file |
| 98 | log4j.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 |
| 103 | log4j.logger.org.openecomp.ncomp.sirius.manager.uploaded=info, uploaded |
| 104 | log4j.additivity.org.openecomp.ncomp.sirius.manager.uploaded=false |
| 105 | ## request logging |
| 106 | log4j.logger.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=info, requests |
| 107 | log4j.additivity.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=false |
| 108 | ## openstack polling |
| 109 | log4j.logger.org.openecomp.ncomp.openstack.OpenStackUtil.polling=info, polling |
| 110 | log4j.additivity.org.openecomp.ncomp.openstack.OpenStackUtil.polling=false |
| 111 | log4j.appender.file=org.apache.log4j.RollingFileAppender |
| 112 | log4j.appender.file.File=logs/manager.log |
| 113 | log4j.appender.file.layout=org.apache.log4j.PatternLayout |
| 114 | log4j.appender.file.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 115 | log4j.appender.file.MaxFileSize=50MB |
| 116 | log4j.appender.file.MaxBackupIndex=5 |
| 117 | |
| 118 | log4j.appender.uploaded=org.apache.log4j.RollingFileAppender |
| 119 | log4j.appender.uploaded.File=logs/manager-uploaded.log |
| 120 | log4j.appender.uploaded.layout=org.apache.log4j.PatternLayout |
| 121 | log4j.appender.uploaded.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 122 | log4j.appender.uploaded.MaxFileSize=50MB |
| 123 | log4j.appender.uploaded.MaxBackupIndex=5 |
| 124 | |
| 125 | log4j.appender.requests=org.apache.log4j.RollingFileAppender |
| 126 | log4j.appender.requests.File=logs/manager-requests.log |
| 127 | log4j.appender.requests.layout=org.apache.log4j.PatternLayout |
| 128 | log4j.appender.requests.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 129 | log4j.appender.requests.MaxFileSize=50MB |
| 130 | log4j.appender.requests.MaxBackupIndex=5 |
| 131 | log4j.appender.polling=org.apache.log4j.RollingFileAppender |
| 132 | log4j.appender.polling.File=logs/manager-polling.log |
| 133 | log4j.appender.polling.layout=org.apache.log4j.PatternLayout |
| 134 | log4j.appender.polling.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 135 | log4j.appender.polling.MaxFileSize=50MB |
| 136 | log4j.appender.polling.MaxBackupIndex=5 |
| 137 | |
| 138 | ### ECOMP Logging |
| 139 | log4j.logger.org.openecomp.audit=info, audit |
| 140 | log4j.additivity.org.openecomp.audit=false |
| 141 | log4j.logger.org.openecomp.metrics=info, metrics |
| 142 | log4j.additivity.org.openecomp.metrics=false |
| 143 | log4j.logger.org.openecomp.error=info, error |
| 144 | log4j.additivity.org.openecomp.error=false |
| 145 | log4j.logger.com.att.eelf.debug=info, debug |
| 146 | log4j.additivity.org.openecomp.debug=false |
| 147 | log4j.appender.audit=org.apache.log4j.RollingFileAppender |
| 148 | log4j.appender.audit.File=logs/audit.log |
| 149 | log4j.appender.audit.layout=org.apache.log4j.PatternLayout |
| 150 | log4j.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 |
| 151 | log4j.appender.audit.MaxFileSize=50MB |
| 152 | log4j.appender.audit.MaxBackupIndex=5 |
| 153 | log4j.appender.metrics=org.apache.log4j.RollingFileAppender |
| 154 | log4j.appender.metrics.File=logs/metrics.log |
| 155 | log4j.appender.metrics.layout=org.apache.log4j.PatternLayout |
| 156 | log4j.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 |
| 157 | log4j.appender.metrics.MaxFileSize=50MB |
| 158 | log4j.appender.metrics.MaxBackupIndex=5 |
| 159 | log4j.appender.error=org.apache.log4j.RollingFileAppender |
| 160 | log4j.appender.error.File=logs/error.log |
| 161 | log4j.appender.error.layout=org.apache.log4j.PatternLayout |
| 162 | log4j.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 |
| 163 | log4j.appender.error.MaxFileSize=50MB |
| 164 | log4j.appender.error.MaxBackupIndex=5 |
| 165 | log4j.appender.debug=org.apache.log4j.RollingFileAppender |
| 166 | log4j.appender.debug.File=logs/debug.log |
| 167 | log4j.appender.debug.layout=org.apache.log4j.PatternLayout |
| 168 | log4j.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 |
| 169 | log4j.appender.debug.MaxFileSize=50MB |
| 170 | log4j.appender.debug.MaxBackupIndex=5 |
| 171 | EOF_CONFIG |
| 172 | |
| 173 | |
| 174 | ## Adding configuration file: vm-cdap-cluster-manager.properties |
| 175 | cat > /tmp/vm-cdap-cluster-manager.properties << EOF_CONFIG |
| 176 | server.dir = data/resources |
| 177 | metrics.dir = data/metrics |
| 178 | properties.dir = data/properties |
| 179 | server.port = 1999 |
| 180 | server.user.console = NTJhYWU1NzAwMzc3OTk1 |
| 181 | server.user.gui = MDlhZWVjZWEwMmFiOTJi |
| 182 | server.user.client = YmE2OGE1N2U5NzRmMDg1 |
| 183 | EOF_CONFIG |
| 184 | |
| 185 | |
| 186 | ## Adding configuration file: vm-cdap-cluster-runtime.properties |
| 187 | cat > /tmp/vm-cdap-cluster-runtime.properties << EOF_CONFIG |
| 188 | factory.vm=org.openecomp.dcae.controller.service.servers.vm.DcaeVmFactory |
| 189 | |
| 190 | ## Adding configuration file: monitoring-agent-gui.properties |
| 191 | cat > /tmp/monitoring-agent-gui.properties << EOF_CONFIG |
| 192 | EOF_CONFIG |
| 193 | |
| 194 | |
| 195 | cat > /tmp/certificate.pkcs12.b64code << EOF_CERT |
| 196 | EOF_CERT |
| 197 | |
| 198 | |
| 199 | ############################################################## |
| 200 | ################## Config Provisioning ####################### |
| 201 | ############################################################## |
| 202 | |
| 203 | mkdir -p ~/.ssh |
| 204 | touch ~/.ssh/authorized_keys |
| 205 | echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBn8Ctt5hJGkTQaffuSeINeABV4viBIM4TcP14kaLiWR1LkyNY+TaUnjxODobtZa4YW1lxFtoMCfZt2A5W9ZZPM+shZr4BOj+wU+xIrzn7ezN/CQjH7c4Wh0mWteuPnJrtdpyGQ/qBI2T+xo5G/Tl++SPUvvN2D4H8vl0miEgVPR47/P7Ba6kl7Bmrf9m0VDPdS69Qr2AhgBq5Qi/fTeGZA4sfKDHHRJxkQIXYmS8R5FISRpBD7ta2NTHapRz9dC6Cw8UttEFiWFUBjN6lwF9LUOkj9MiqiTQaElKKQzMIHr0AhlgIkwBLKAJoDrGQD9GKPwKCdW3OmnODMPxJjXc3 > ~/.ssh/authorized_keys |
| 206 | |
| 207 | cp /tmp/ecomp-nexus.crt /usr/local/share/ca-certificates/ ; update-ca-certificates |
| 208 | |
| 209 | wget 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 | |
| 211 | cd /opt/app/dcae-controller-core-utils |
| 212 | unzip -o dcae-controller-core-utils*.zip |
| 213 | |
| 214 | chown -R dcae:dcae /opt/app/dcae-controller-core-utils |
| 215 | |
| 216 | /opt/app/dcae-controller-core-utils/bin/fs-init.py |
| 217 | |
| 218 | wget 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 | |
| 220 | cd /opt/app/dcae-controller-service-cdap-cluster-manager |
| 221 | unzip -o dcae-controller-service-cdap-cluster-manager*.zip |
| 222 | |
| 223 | chown -R dcae:dcae /opt/app/dcae-controller-service-cdap-cluster-manager |
| 224 | |
| 225 | wget 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 | |
| 227 | chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub |
| 228 | |
| 229 | curl -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 | |
| 231 | curl -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 | |
| 233 | curl -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 |
| 234 | mkdir -p /opt/app/cask-hello-world/lib |
| 235 | mv /tmp/HelloWorld-3.5.1.jar /opt/app/cask-hello-world/lib |
| 236 | |
| 237 | find /opt -type f -exec sed -i 's/sudo//g' {} \; |
| 238 | |
| 239 | apt-key adv --keyserver-options --keyserver keyserver.ubuntu.com --recv 07513CAD |
| 240 | wget -qO - http://repository.cask.co/ubuntu/precise/amd64/cdap/3.5/pubkey.gpg | apt-key add - |
| 241 | |
| 242 | wget 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 | |
| 244 | cd /opt/app/dcae-controller-service-dmaap-drsub-manager |
| 245 | unzip -o dcae-controller-service-dmaap-drsub-manager-1.1.0-runtime.zip |
| 246 | |
| 247 | chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub-manager |
| 248 | |
| 249 | mkdir /home/dcae/.ssh |
| 250 | chmod og-rwx /home/dcae/.ssh |
| 251 | chown -R dcae:dcae /home/dcae/.ssh |
| 252 | touch /home/dcae/.ssh/authorized_keys |
| 253 | chmod og-rwx /home/dcae/.ssh/authorized_keys |
| 254 | chown -R dcae:dcae /home/dcae/.ssh/authorized_keys |
| 255 | echo 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 |