| Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 1 | #!/bin/bash -xe | 
|  | 2 |  | 
| Jiri Broulik | ddd5526 | 2018-04-11 14:52:43 +0200 | [diff] [blame] | 3 | FORMULA_VERSION=${FORMULA_VERSION:-2018.3.1} | 
| Jiri Broulik | 05c5b60 | 2018-04-11 13:52:37 +0200 | [diff] [blame] | 4 | APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"} | 
|  | 5 |  | 
| Jiri Broulik | aa400a0 | 2018-04-12 00:18:47 +0200 | [diff] [blame^] | 6 | salt-call -t 5 --retcode-passthrough reclass.validate_pillar | 
|  | 7 |  | 
| Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 8 | echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list | 
|  | 9 | apt-get update | 
|  | 10 | apt-get install salt-formula* -y | 
|  | 11 | salt-call saltutil.refresh_pillar | 
|  | 12 | salt-call saltutil.sync_all | 
|  | 13 | salt-call -t 5 --retcode-passthrough --no-color state.sls salt | 
| Jiri Broulik | aa400a0 | 2018-04-12 00:18:47 +0200 | [diff] [blame^] | 14 | salt-call -t 5 --retcode-passthrough --no-color state.sls linux.system.repo,linux.system.package,linux.system.user,linux.system.directory,linux.system.config | 
| Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 15 | salt-call -t 5 --retcode-passthrough --no-color state.sls linux.network | 
| Jiri Broulik | aa400a0 | 2018-04-12 00:18:47 +0200 | [diff] [blame^] | 16 | salt-call -t 5 --retcode-passthrough --no-color state.sls openssh | 
| Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 17 | salt-call -t 5 --retcode-passthrough --no-color state.sls git.server | 
|  | 18 | salt-call -t 5 --retcode-passthrough --no-color state.sls postgresql | 
|  | 19 | salt-call -t 5 --no-color state.sls maas | 
|  | 20 | # will not be needed with new maas formula | 
|  | 21 | apt-get install simplestreams -y | 
|  | 22 | sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg http://images.maas.io/ephemeral-v3/daily/ /var/www/html/maas/images/ephemeral-v3/daily 'arch=amd64' 'release~(xenial)' --max=1 | 
|  | 23 |  | 
|  | 24 | salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.master | 
|  | 25 | sleep 60 | 
|  | 26 | salt-call -t 5 --no-color state.sls jenkins.client.plugin | 
|  | 27 | systemctl restart jenkins | 
|  | 28 | sleep 60 | 
|  | 29 | # Jenkins Mirantis theme | 
|  | 30 | git clone https://github.com/Mirantis/docker-jenkins.git | 
|  | 31 | cp -r docker-jenkins/theme /var/lib/jenkins/userContent | 
|  | 32 | chown -R jenkins:jenkins /var/lib/jenkins/userContent/* | 
|  | 33 | # finish Jenkins setup | 
|  | 34 | salt-call -t 5 --no-color state.sls jenkins.client.plugin | 
|  | 35 | systemctl restart jenkins | 
|  | 36 | sleep 60 | 
|  | 37 | salt-call -t 5 --no-color state.sls jenkins.client | 
|  | 38 | systemctl restart jenkins | 
|  | 39 | sleep 60 | 
|  | 40 | salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.client | 
|  | 41 |  |