blob: a49b27412e40395a73849c230b21fa502790fb83 [file] [log] [blame]
Jiri Broulik4ea221c2018-04-10 13:48:06 +02001#!/bin/bash -xe
2
Jiri Broulikddd55262018-04-11 14:52:43 +02003FORMULA_VERSION=${FORMULA_VERSION:-2018.3.1}
Jiri Broulik05c5b602018-04-11 13:52:37 +02004APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"}
azvyagintsev0adfe682018-06-13 16:29:40 +03005SALT_OPTS="-t 10 --retcode-passthrough --no-color"
Jiri Broulik05c5b602018-04-11 13:52:37 +02006
azvyagintsev0adfe682018-06-13 16:29:40 +03007salt-call ${SALT_OPTS} reclass.validate_pillar
Jiri Broulikaa400a02018-04-12 00:18:47 +02008
Jiri Broulik4ea221c2018-04-10 13:48:06 +02009echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list
10apt-get update
11apt-get install salt-formula* -y
azvyagintsev0adfe682018-06-13 16:29:40 +030012
Jiri Broulik4ea221c2018-04-10 13:48:06 +020013salt-call saltutil.refresh_pillar
14salt-call saltutil.sync_all
azvyagintsev0adfe682018-06-13 16:29:40 +030015salt-call ${SALT_OPTS} state.sls salt
16salt-call ${SALT_OPTS} state.sls linux.system.repo,linux.system.package,linux.system.user,linux.system.directory,linux.system.config
17salt-call ${SALT_OPTS} state.sls linux.network
18salt-call ${SALT_OPTS} state.sls openssh
19salt-call ${SALT_OPTS} state.sls git.server
azvyagintsev0f697cf2018-06-22 11:44:13 +030020sleep 99h || true
azvyagintsev0adfe682018-06-13 16:29:40 +030021salt-call ${SALT_OPTS} state.sls postgresql
22# install only MAAS packages, don't configure anything.
23# Configuration will be processed during cfg01 initialization.
24# Those step, required to have clean MAAS configuration - w\o auto import and etc.
25salt-call ${SALT_OPTS} state.sls_id maas_cluster_packages maas
26salt-call ${SALT_OPTS} state.sls_id maas_region_packages maas
27
Jiri Broulik3ffb7452018-04-12 10:37:07 +020028# linux.system.file only for backwards compatibility of jenkins - mcp-common-scripts
azvyagintsev0adfe682018-06-13 16:29:40 +030029salt-call ${SALT_OPTS} state.sls jenkins.master,linux.system.file
Jiri Broulik4ea221c2018-04-10 13:48:06 +020030sleep 60
31salt-call -t 5 --no-color state.sls jenkins.client.plugin
32systemctl restart jenkins
33sleep 60
34# Jenkins Mirantis theme
azvyagintsev0adfe682018-06-13 16:29:40 +030035# FIXME move those into cluster model
Jiri Broulik4ea221c2018-04-10 13:48:06 +020036git clone https://github.com/Mirantis/docker-jenkins.git
37cp -r docker-jenkins/theme /var/lib/jenkins/userContent
38chown -R jenkins:jenkins /var/lib/jenkins/userContent/*
39# finish Jenkins setup
40salt-call -t 5 --no-color state.sls jenkins.client.plugin
41systemctl restart jenkins
42sleep 60
43salt-call -t 5 --no-color state.sls jenkins.client
44systemctl restart jenkins
45sleep 60
azvyagintsev0adfe682018-06-13 16:29:40 +030046salt-call ${SALT_OPTS} state.sls jenkins.client
Jiri Broulik4ea221c2018-04-10 13:48:06 +020047