Mike Elliott | 586f03b | 2017-09-08 12:46:15 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | cat > /tmp/dcae_install.sh << EOF_DCAE_INSTALL |
| 3 | #!/bin/bash |
| 4 | set -x |
| 5 | cd /tmp |
| 6 | |
| 7 | export DEBIAN_FRONTEND=noninteractive |
| 8 | |
| 9 | #### Using special configuration resource: instances/vm-postgresql/iad4.yaml |
| 10 | ## Adding configuration file: main |
| 11 | cat | cat > /tmp/postgres.conf << EOF_CONFIG |
| 12 | master: zldciad4vipstg00 |
| 13 | secondmaster: notused |
| 14 | DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks |
| 15 | DRTR_NODE_KSTOREPASS: "No Certificate" |
| 16 | DRTR_NODE_PVTKEYPASS: "No Certificate" |
| 17 | PG_NODES : zldciad4vipstg00 |
| 18 | PG_JAVA_HOME : /opt/app/java/jdk/jdk170 |
| 19 | PG_CLUSTER : site |
| 20 | EOF_CONFIG |
| 21 | |
| 22 | ## Adding configuration file: mount_config |
| 23 | cat | cat > /tmp/dcae-mount.conf << EOF_CONFIG |
| 24 | osType: ubuntu |
| 25 | volumes: |
| 26 | opt: |
| 27 | uuid: ephemeral |
| 28 | size: 80 |
| 29 | filesystems: |
| 30 | /opt/tools: |
| 31 | size: 80 |
| 32 | type: ext4 |
| 33 | mount_opts: '' |
| 34 | dbroot: |
| 35 | uuid: cinder |
| 36 | size: 75 |
| 37 | filesystems: |
| 38 | /dbroot/pgdata: |
| 39 | size: 50 |
| 40 | type: ext4 |
| 41 | mount_opts: '' |
| 42 | /dbroot/pglogs: |
| 43 | size: 25 |
| 44 | type: ext4 |
| 45 | mount_opts: '' |
| 46 | |
| 47 | EOF_CONFIG |
| 48 | |
| 49 | ## Adding configuration file: ecomp-nexus |
| 50 | cat > /tmp/ecomp-nexus.crt << EOF_CONFIG |
| 51 | -----BEGIN CERTIFICATE----- |
| 52 | MIIDtzCCAp+gAwIBAgIEet16RjANBgkqhkiG9w0BAQsFADB2MQswCQYDVQQGEwJVUzEUMBIGA1UE |
| 53 | CBMLVW5zcGVjaWZpZWQxFDASBgNVBAcTC1Vuc3BlY2lmaWVkMREwDwYDVQQKEwhTb25hdHlwZTEQ |
| 54 | MA4GA1UECxMHRXhhbXBsZTEWMBQGA1UEAwwNKi5lY29tcC1uZXh1czAeFw0xNjExMTQxMDE5NDJa |
| 55 | Fw0zMDA3MjQxMDE5NDJaMHYxCzAJBgNVBAYTAlVTMRQwEgYDVQQIEwtVbnNwZWNpZmllZDEUMBIG |
| 56 | A1UEBxMLVW5zcGVjaWZpZWQxETAPBgNVBAoTCFNvbmF0eXBlMRAwDgYDVQQLEwdFeGFtcGxlMRYw |
| 57 | FAYDVQQDDA0qLmVjb21wLW5leHVzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqkDu |
| 58 | vC91cZxOaRMYGHSyDeuw4hyXjqyD5Etl5L5TNN7+uFKEtvXsRYOxtD62TqWHKozffLE5o6zoRZL4 |
| 59 | 8qNTQyAx0LaEfWfR2w0jat+UqtqEtW0xpOD0/O0qRq5Y/XG3Yr8SQ/y84Pr1FIflM7pM4PZTt3kc |
| 60 | UfqzbaONW5K8t+UG+5jgNXdRk3hln8WMunVZeci0J6TV+tWs9tOeAKBdpI7K7LV+FJBaF8vBAw2x |
| 61 | 8AhlNPXKQUhK+M3DD73c1aLWrZ3mIwJXt2oQUDwgtXGCPR1/Z9f2tTAoDxpzvkwtP/BtH3qvgtpY |
| 62 | QfDNmWbJVHh6ll39Hapt7V0v4aCRSN21ZQIDAQABo00wSzAMBgNVHRMEBTADAQH/MBwGA1UdEQQV |
| 63 | MBOCC2Vjb21wLW5leHVzhwQK0MVLMB0GA1UdDgQWBBQxcUlk/lkKkwSz0GuewbXptJxl+zANBgkq |
| 64 | hkiG9w0BAQsFAAOCAQEAPnNbtdreMZaUSjv+1eqpriLKquwnZhnwWENn1u3sw4hTAWQc+ehhogGg |
| 65 | eIqPN81Dt3jhr0bYZW+r3gGq7tgrLxdSXso8bTtqHsFLszirgWcQXDlBQGnw9wqp/KBzeDJInJep |
| 66 | d6aGu3yBXV6459S/mClxZTSvsR+Vz3rRWxx01R3/ft5/myqrRMDnEncqPopTbEamBuUJL3eJDpFO |
| 67 | xlVqYR3y6AXwwguMaTiHMfFBmDOVaz4K8Qy6AaHH9eoch9fxOJ/7ASvqSwkC9GYTJSnF2vE37rmH |
| 68 | kPp//Vm4WSnQ2NrBGkH9rUUdYdDdgWJYnTeZ+YFd8J6z9xNiEn9QKQNNcA== |
| 69 | -----END CERTIFICATE----- |
| 70 | |
| 71 | EOF_CONFIG |
| 72 | ## Adding configuration file: vm-postgresql-console.properties |
| 73 | cat > /tmp/vm-postgresql-console.properties << EOF_CONFIG |
| 74 | localhost.endpoint=http://localhost:9999 |
| 75 | localhost.user=console |
| 76 | localhost.password=MDBmMzE0NTgyMDU1NmVj |
| 77 | EOF_CONFIG |
| 78 | |
| 79 | ## Adding configuration file: vm-postgresql-gui.properties |
| 80 | cat > /tmp/vm-postgresql-gui.properties << EOF_CONFIG |
| 81 | EOF_CONFIG |
| 82 | |
| 83 | ## Adding configuration file: vm-postgresql-log4j.properties |
| 84 | cat > /tmp/vm-postgresql-log4j.properties << EOF_CONFIG |
| 85 | #log4j.debug=0 |
| 86 | log4j.rootLogger=warn, file |
| 87 | log4j.logger.org.openecomp.ncomp=info, file |
| 88 | log4j.additivity.org.openecomp.ncomp=false |
| 89 | |
| 90 | #log4j.logger.org.apache.http.headers=debug, file |
| 91 | #log4j.logger.org.apache.http.wire=debug, file |
| 92 | ## uploaded logger |
| 93 | log4j.logger.org.openecomp.ncomp.sirius.manager.uploaded=info, uploaded |
| 94 | log4j.additivity.org.openecomp.ncomp.sirius.manager.uploaded=false |
| 95 | ## request logging |
| 96 | log4j.logger.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=info, requests |
| 97 | log4j.additivity.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=false |
| 98 | ## openstack polling |
| 99 | log4j.logger.org.openecomp.ncomp.openstack.OpenStackUtil.polling=info, polling |
| 100 | log4j.additivity.org.openecomp.ncomp.openstack.OpenStackUtil.polling=false |
| 101 | log4j.appender.file=org.apache.log4j.RollingFileAppender |
| 102 | log4j.appender.file.File=logs/manager.log |
| 103 | log4j.appender.file.layout=org.apache.log4j.PatternLayout |
| 104 | log4j.appender.file.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 105 | log4j.appender.file.MaxFileSize=50MB |
| 106 | log4j.appender.file.MaxBackupIndex=5 |
| 107 | |
| 108 | log4j.appender.uploaded=org.apache.log4j.RollingFileAppender |
| 109 | log4j.appender.uploaded.File=logs/manager-uploaded.log |
| 110 | log4j.appender.uploaded.layout=org.apache.log4j.PatternLayout |
| 111 | log4j.appender.uploaded.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 112 | log4j.appender.uploaded.MaxFileSize=50MB |
| 113 | log4j.appender.uploaded.MaxBackupIndex=5 |
| 114 | |
| 115 | log4j.appender.requests=org.apache.log4j.RollingFileAppender |
| 116 | log4j.appender.requests.File=logs/manager-requests.log |
| 117 | log4j.appender.requests.layout=org.apache.log4j.PatternLayout |
| 118 | log4j.appender.requests.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 119 | log4j.appender.requests.MaxFileSize=50MB |
| 120 | log4j.appender.requests.MaxBackupIndex=5 |
| 121 | log4j.appender.polling=org.apache.log4j.RollingFileAppender |
| 122 | log4j.appender.polling.File=logs/manager-polling.log |
| 123 | log4j.appender.polling.layout=org.apache.log4j.PatternLayout |
| 124 | log4j.appender.polling.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n |
| 125 | log4j.appender.polling.MaxFileSize=50MB |
| 126 | log4j.appender.polling.MaxBackupIndex=5 |
| 127 | |
| 128 | ### ECOMP Logging |
| 129 | log4j.logger.org.openecomp.audit=info, audit |
| 130 | log4j.additivity.org.openecomp.audit=false |
| 131 | log4j.logger.org.openecomp.metrics=info, metrics |
| 132 | log4j.additivity.org.openecomp.metrics=false |
| 133 | log4j.logger.org.openecomp.error=info, error |
| 134 | log4j.additivity.org.openecomp.error=false |
| 135 | log4j.logger.com.att.eelf.debug=info, debug |
| 136 | log4j.additivity.org.openecomp.debug=false |
| 137 | log4j.appender.audit=org.apache.log4j.RollingFileAppender |
| 138 | log4j.appender.audit.File=logs/audit.log |
| 139 | log4j.appender.audit.layout=org.apache.log4j.PatternLayout |
| 140 | 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 |
| 141 | log4j.appender.audit.MaxFileSize=50MB |
| 142 | log4j.appender.audit.MaxBackupIndex=5 |
| 143 | log4j.appender.metrics=org.apache.log4j.RollingFileAppender |
| 144 | log4j.appender.metrics.File=logs/metrics.log |
| 145 | log4j.appender.metrics.layout=org.apache.log4j.PatternLayout |
| 146 | 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 |
| 147 | log4j.appender.metrics.MaxFileSize=50MB |
| 148 | log4j.appender.metrics.MaxBackupIndex=5 |
| 149 | log4j.appender.error=org.apache.log4j.RollingFileAppender |
| 150 | log4j.appender.error.File=logs/error.log |
| 151 | log4j.appender.error.layout=org.apache.log4j.PatternLayout |
| 152 | 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 |
| 153 | log4j.appender.error.MaxFileSize=50MB |
| 154 | log4j.appender.error.MaxBackupIndex=5 |
| 155 | log4j.appender.debug=org.apache.log4j.RollingFileAppender |
| 156 | log4j.appender.debug.File=logs/debug.log |
| 157 | log4j.appender.debug.layout=org.apache.log4j.PatternLayout |
| 158 | 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 |
| 159 | log4j.appender.debug.MaxFileSize=50MB |
| 160 | log4j.appender.debug.MaxBackupIndex=5 |
| 161 | EOF_CONFIG |
| 162 | |
| 163 | ## Adding configuration file: vm-postgresql-manager.properties |
| 164 | cat > /tmp/vm-postgresql-manager.properties << EOF_CONFIG |
| 165 | server.dir = data/resources |
| 166 | metrics.dir = data/metrics |
| 167 | properties.dir = data/properties |
| 168 | server.port = 9999 |
| 169 | server.user.console = MDBmMzE0NTgyMDU1NmVj |
| 170 | server.user.gui = M2NiOTg1YzNiYTI2NTJh |
| 171 | server.user.client = OTNmMmFkYzkxMzYzNTk0 |
| 172 | EOF_CONFIG |
| 173 | |
| 174 | ## Adding configuration file: vm-postgresql-runtime.properties |
| 175 | cat > /tmp/vm-postgresql-runtime.properties << EOF_CONFIG |
| 176 | factory.vm=org.openecomp.dcae.controller.service.servers.vm.DcaeVmFactory |
| 177 | factory.postgres=org.openecomp.dcae.controller.service.storage.postgres.service.impl.ServicePackageImpl |
| 178 | EOF_CONFIG |
| 179 | |
| 180 | ## Adding configuration file: vm-postgresql-hosts |
| 181 | cat > /tmp/vm-postgresql-hosts << EOF_CONFIG |
| 182 | EOF_CONFIG |
| 183 | |
| 184 | ## Adding configuration file: monitoring-agent-gui.properties |
| 185 | cat > /tmp/monitoring-agent-gui.properties << EOF_CONFIG |
| 186 | EOF_CONFIG |
| 187 | |
| 188 | cat >> /etc/hosts << HOSTS_EOF |
| 189 | HOSTS_EOF |
| 190 | |
| 191 | cat > /tmp/certificate.pkcs12.b64code << EOF_CERT |
| 192 | EOF_CERT |
| 193 | |
| 194 | ############################################################## |
| 195 | ##################### CLOUDINIT ############################## |
| 196 | ############################################################## |
| 197 | |
| 198 | ## need to fix cloudinit in Centos. |
| 199 | |
| 200 | CLOUDHOSTCFG=/etc/cloud/cloud.cfg.d/99_hostname.cfg |
| 201 | if [ -f /etc/redhat-release ]; then |
| 202 | # CentOS/RHEL |
| 203 | ( echo "hostname: \$(hostname)"; echo "fqdn: \$(hostname -f)" ) > \$CLOUDHOSTCFG |
| 204 | fi |
| 205 | |
| 206 | mkdir -p ~/.ssh |
| 207 | touch ~/.ssh/authorized_keys |
| 208 | |
| 209 | echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCYz++VKcW3Sw0Sh7fFyTIjXED6NUUNYbje7awcnvaHHAC0rUxs7boX6hmWDViXoGZA5xw4Xhk5kIEs+zxMCDlF1q/9rbyq5ndonlBz3aPx7+SBqVR5sPalbSr8dJhGPwpj/0Df+FzqjGVL2p2d4VV7SeT/kKrNcSY6SmYHln6osoGFAHsOZC0d+fiba4zfCI9EI6zHdyCujwayjQ5W5UgA50XQ0KXpI5WtF6MOwO6jPL3SNNDlWobG/nsCAMxTQ04dALpYSoamM12Ps72MfxEwaKkoAcsH6WsFbuvoUSXwNcosmyxYrxNynsUz4C2Tz+PZqelGvm8Y8MtNuhN7oqAD root@ecomp-jumpbox >> /home/ubuntu/.ssh/authorized_keys |
| 210 | |
| 211 | ######### step-1 |
| 212 | |
| 213 | cp /tmp/ecomp-nexus.crt /usr/local/share/ca-certificates/ ; update-ca-certificates |
| 214 | |
| 215 | ######### step-2 |
| 216 | |
| 217 | echo 162.242.254.138 ecomp-nexus >> /etc/hosts |
| 218 | |
| 219 | ######### step-3 |
| 220 | |
| 221 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 222 | |
| 223 | case runtime in |
| 224 | %*) |
| 225 | A1=org.openecomp.dcae.controller:dcae-controller-core-utils:1.0.0:zip |
| 226 | ;; |
| 227 | *) |
| 228 | A1=org.openecomp.dcae.controller:dcae-controller-core-utils:1.0.0:zip:runtime |
| 229 | ;; |
| 230 | esac |
| 231 | |
| 232 | wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-core-utils/1.0.0/dcae-controller-core-utils-1.0.0-runtime.zip -P /opt/app/dcae-controller-core-utils |
| 233 | |
| 234 | case zip in |
| 235 | jar) |
| 236 | mkdir /opt/app/dcae-controller-core-utils/lib |
| 237 | mv /opt/app/dcae-controller-core-utils/*.jar /opt/app/dcae-controller-core-utils/lib |
| 238 | ;; |
| 239 | zip) |
| 240 | ( cd /opt/app/dcae-controller-core-utils ; unzip -o dcae-controller-core-utils*.zip ) |
| 241 | ;; |
| 242 | esac |
| 243 | |
| 244 | chown -R dcae:dcae /opt/app/dcae-controller-core-utils |
| 245 | |
| 246 | ######### step-4 |
| 247 | |
| 248 | /opt/app/dcae-controller-core-utils/bin/fs-init.py |
| 249 | |
| 250 | ######### step-5 |
| 251 | |
| 252 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 253 | |
| 254 | case runtime in |
| 255 | %*) |
| 256 | A1=org.openecomp.dcae.controller:dcae-controller-service-common-vm-manager:1.0.0:zip |
| 257 | ;; |
| 258 | *) |
| 259 | A1=org.openecomp.dcae.controller:dcae-controller-service-common-vm-manager:1.0.0:zip:runtime |
| 260 | ;; |
| 261 | esac |
| 262 | |
| 263 | wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-common-vm-manager/1.0.0/dcae-controller-service-common-vm-manager-1.0.0-runtime.zip -P /opt/app/dcae-controller-service-common-vm-manager |
| 264 | |
| 265 | case zip in |
| 266 | jar) |
| 267 | mkdir /opt/app/dcae-controller-service-common-vm-manager/lib |
| 268 | mv /opt/app/dcae-controller-service-common-vm-manager/*.jar /opt/app/dcae-controller-service-common-vm-manager/lib |
| 269 | ;; |
| 270 | zip) |
| 271 | ( cd /opt/app/dcae-controller-service-common-vm-manager ; unzip -o dcae-controller-service-common-vm-manager*.zip ) |
| 272 | ;; |
| 273 | esac |
| 274 | |
| 275 | chown -R dcae:dcae /opt/app/dcae-controller-service-common-vm-manager |
| 276 | |
| 277 | ######### step-6 |
| 278 | |
| 279 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 280 | |
| 281 | case %{assemblyId} in |
| 282 | %*) |
| 283 | A1=org.openecomp.dcae.controller:dcae-controller-service-storage-postgres-model:1.0.0:jar |
| 284 | ;; |
| 285 | *) |
| 286 | A1=org.openecomp.dcae.controller:dcae-controller-service-storage-postgres-model:1.0.0:jar:%{assemblyId} |
| 287 | ;; |
| 288 | esac |
| 289 | |
| 290 | wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-storage-postgres-model/1.0.0/dcae-controller-service-storage-postgres-model-1.0.0.jar -P /opt/app/dcae-controller-service-storage-postgres-model |
| 291 | |
| 292 | case jar in |
| 293 | jar) |
| 294 | mkdir /opt/app/dcae-controller-service-storage-postgres-model/lib |
| 295 | mv /opt/app/dcae-controller-service-storage-postgres-model/*.jar /opt/app/dcae-controller-service-storage-postgres-model/lib |
| 296 | ;; |
| 297 | zip) |
| 298 | ( cd /opt/app/dcae-controller-service-storage-postgres-model ; unzip -o dcae-controller-service-storage-postgres-model*.zip ) |
| 299 | ;; |
| 300 | esac |
| 301 | |
| 302 | chown -R dcae:dcae /opt/app/dcae-controller-service-storage-postgres-model |
| 303 | |
| 304 | ######### step-7 |
| 305 | |
| 306 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 307 | |
| 308 | OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-cdf_1.0.0.deb` |
| 309 | |
| 310 | case deb in |
| 311 | deb) |
| 312 | dpkg --install \$OUT |
| 313 | ;; |
| 314 | jar) |
| 315 | mkdir -p /opt/app/%{artifactId}/lib |
| 316 | mv \$OUT /opt/app/%{artifactId}/lib |
| 317 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 318 | ;; |
| 319 | zip) |
| 320 | mkdir -p /opt/app/%{artifactId}/lib |
| 321 | ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) |
| 322 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 323 | ;; |
| 324 | esac |
| 325 | |
| 326 | ######### step-8 |
| 327 | |
| 328 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 329 | |
| 330 | OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-prep_1.0.0.deb` |
| 331 | |
| 332 | case deb in |
| 333 | deb) |
| 334 | dpkg --install \$OUT |
| 335 | ;; |
| 336 | jar) |
| 337 | mkdir -p /opt/app/%{artifactId}/lib |
| 338 | mv \$OUT /opt/app/%{artifactId}/lib |
| 339 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 340 | ;; |
| 341 | zip) |
| 342 | mkdir -p /opt/app/%{artifactId}/lib |
| 343 | ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) |
| 344 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 345 | ;; |
| 346 | esac |
| 347 | |
| 348 | ######### step-9 |
| 349 | |
| 350 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 351 | |
| 352 | OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-config_1.0.0.deb` |
| 353 | |
| 354 | case deb in |
| 355 | deb) |
| 356 | dpkg --install \$OUT |
| 357 | ;; |
| 358 | jar) |
| 359 | mkdir -p /opt/app/%{artifactId}/lib |
| 360 | mv \$OUT /opt/app/%{artifactId}/lib |
| 361 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 362 | ;; |
| 363 | zip) |
| 364 | mkdir -p /opt/app/%{artifactId}/lib |
| 365 | ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) |
| 366 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 367 | ;; |
| 368 | esac |
| 369 | |
| 370 | ######### step-10 |
| 371 | |
| 372 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 373 | |
| 374 | OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas_1.0.0.deb` |
| 375 | |
| 376 | case deb in |
| 377 | deb) |
| 378 | dpkg --install \$OUT |
| 379 | ;; |
| 380 | jar) |
| 381 | mkdir -p /opt/app/%{artifactId}/lib |
| 382 | mv \$OUT /opt/app/%{artifactId}/lib |
| 383 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 384 | ;; |
| 385 | zip) |
| 386 | mkdir -p /opt/app/%{artifactId}/lib |
| 387 | ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) |
| 388 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 389 | ;; |
| 390 | esac |
| 391 | |
| 392 | touch /etc/sudoers.d/dcae-postgres |
| 393 | echo "dcae ALL=(postgres) NOPASSWD: ALL" > /etc/sudoers.d/dcae-postgres |
| 394 | |
| 395 | /opt/app/postgresql-prep/bin/iDNS-responder.py & |
| 396 | |
| 397 | /etc/init.d/cron restart |
| 398 | |
| 399 | ######### step-11 |
| 400 | |
| 401 | if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi |
| 402 | |
| 403 | OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas-post_1.0.0.deb` |
| 404 | case deb in |
| 405 | deb) |
| 406 | dpkg --install \$OUT |
| 407 | ;; |
| 408 | jar) |
| 409 | mkdir -p /opt/app/%{artifactId}/lib |
| 410 | mv \$OUT /opt/app/%{artifactId}/lib |
| 411 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 412 | ;; |
| 413 | zip) |
| 414 | mkdir -p /opt/app/%{artifactId}/lib |
| 415 | ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) |
| 416 | chown -R dcae:dcae /opt/app/%{artifactId} |
| 417 | ;; |
| 418 | esac |
| 419 | |
| 420 | ######### step-12 |
| 421 | |
| 422 | find /opt -type f -exec sed -i 's/sudo//g' {} \; |
| 423 | su dcae -c "/opt/app/dcae-controller-service-common-vm-manager/bin/manager.sh config" |
| 424 | su dcae -c "/opt/app/dcae-controller-service-common-vm-manager/bin/manager.sh restart" |
| 425 | |
| 426 | mkdir /home/dcae/.ssh |
| 427 | chmod og-rwx /home/dcae/.ssh |
| 428 | chown -R dcae:dcae /home/dcae/.ssh |
| 429 | touch /home/dcae/.ssh/authorized_keys |
| 430 | chmod og-rwx /home/dcae/.ssh/authorized_keys |
| 431 | chown -R dcae:dcae /home/dcae/.ssh/authorized_keys |
| 432 | echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCYz++VKcW3Sw0Sh7fFyTIjXED6NUUNYbje7awcnvaHHAC0rUxs7boX6hmWDViXoGZA5xw4Xhk5kIEs+zxMCDlF1q/9rbyq5ndonlBz3aPx7+SBqVR5sPalbSr8dJhGPwpj/0Df+FzqjGVL2p2d4VV7SeT/kKrNcSY6SmYHln6osoGFAHsOZC0d+fiba4zfCI9EI6zHdyCujwayjQ5W5UgA50XQ0KXpI5WtF6MOwO6jPL3SNNDlWobG/nsCAMxTQ04dALpYSoamM12Ps72MfxEwaKkoAcsH6WsFbuvoUSXwNcosmyxYrxNynsUz4C2Tz+PZqelGvm8Y8MtNuhN7oqAD root@ecomp-jumpbox >> /home/dcae/.ssh/authorized_keys |
| 433 | #no final script: vm-postgresql.userdata |
| 434 | EOF_DCAE_INSTALL |
| 435 | echo null > /tmp/.password |
| 436 | chmod u+x /tmp/dcae_install.sh |
| 437 | /tmp/dcae_install.sh 2>&1 | tee /tmp/dcae_install.log |