day01 Updates
* Day01:
- remove reclass data from node
- Force maas in unconfigured state
- if you will try to run maas - it will automatically start
import processes = > which fail.
- If you will try to wrap and disable imports (formula allow to do it)
=> maas_config step will never pass.
* Misc:
- for to use freezed bootstrap.saltstack.com.sh
- add qemu-packer disk_compression true - require packer 1.10 +
- decrease mirror image size to 100gb
- apt_preserve_sources_list - force cloud-init to not re-create sources.list
Change-Id: If7c731284f3fd6ca21fe253c05c8ab78213cf9c5
diff --git a/day01-image/scripts/salt.sh b/day01-image/scripts/salt.sh
index 16bafc8..78cdd79 100644
--- a/day01-image/scripts/salt.sh
+++ b/day01-image/scripts/salt.sh
@@ -2,28 +2,36 @@
FORMULA_VERSION=${FORMULA_VERSION:-2018.3.1}
APT_MIRANTIS_SALT_REPO=${APT_MIRANTIS_SALT_REPO:-"http://apt.mirantis.com/xenial/ $FORMULA_VERSION salt"}
+SALT_OPTS="-t 10 --retcode-passthrough --no-color"
-salt-call -t 5 --retcode-passthrough reclass.validate_pillar
+salt-call ${SALT_OPTS} reclass.validate_pillar
echo "deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO}" > /etc/apt/sources.list.d/mcp_salt.list
apt-get update
apt-get install salt-formula* -y
+
salt-call saltutil.refresh_pillar
salt-call saltutil.sync_all
-salt-call -t 5 --retcode-passthrough --no-color state.sls salt
-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
-salt-call -t 5 --retcode-passthrough --no-color state.sls linux.network
-salt-call -t 5 --retcode-passthrough --no-color state.sls openssh
-salt-call -t 5 --retcode-passthrough --no-color state.sls git.server
-salt-call -t 5 --retcode-passthrough --no-color state.sls postgresql
-salt-call -t 5 --no-color state.sls maas
+salt-call ${SALT_OPTS} state.sls salt
+salt-call ${SALT_OPTS} state.sls linux.system.repo,linux.system.package,linux.system.user,linux.system.directory,linux.system.config
+salt-call ${SALT_OPTS} state.sls linux.network
+salt-call ${SALT_OPTS} state.sls openssh
+salt-call ${SALT_OPTS} state.sls git.server
+salt-call ${SALT_OPTS} state.sls postgresql
+# install only MAAS packages, don't configure anything.
+# Configuration will be processed during cfg01 initialization.
+# Those step, required to have clean MAAS configuration - w\o auto import and etc.
+salt-call ${SALT_OPTS} state.sls_id maas_cluster_packages maas
+salt-call ${SALT_OPTS} state.sls_id maas_region_packages maas
+
# linux.system.file only for backwards compatibility of jenkins - mcp-common-scripts
-salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.master,linux.system.file
+salt-call ${SALT_OPTS} state.sls jenkins.master,linux.system.file
sleep 60
salt-call -t 5 --no-color state.sls jenkins.client.plugin
systemctl restart jenkins
sleep 60
# Jenkins Mirantis theme
+# FIXME move those into cluster model
git clone https://github.com/Mirantis/docker-jenkins.git
cp -r docker-jenkins/theme /var/lib/jenkins/userContent
chown -R jenkins:jenkins /var/lib/jenkins/userContent/*
@@ -34,5 +42,5 @@
salt-call -t 5 --no-color state.sls jenkins.client
systemctl restart jenkins
sleep 60
-salt-call -t 5 --retcode-passthrough --no-color state.sls jenkins.client
+salt-call ${SALT_OPTS} state.sls jenkins.client