blob: 3b941760b1963c2f883c42ddcd2d75c2d91eb521 [file] [log] [blame]
Petr Michalec3ae395b2017-09-07 20:15:15 +02001#!/bin/bash
2
3#export HOSTNAME=${`hostname -s`}
4#export DOMAIN=${`hostname -d`}
5cd /srv/salt/scripts; git pull -r || true; source bootstrap.sh || exit 1
6
7# BOOTSTRAP
8if [[ $BOOTSTRAP =~ ^(True|true|1|yes)$ ]]; then
9 # workarounds for kitchen
10 test ! -e /tmp/kitchen || (mkdir -p /srv/salt/reclass; rsync -avh /tmp/kitchen/ /srv/salt/reclass)
11 cd /srv/salt/reclass
12 # clone latest system-level if missing
13 if [[ -e .gitmodules ]] && [[ ! -e classes/system/linux ]]; then
14 git submodule update --init --recursive --remote || true
15 fi
16 source_local_envs
Petr Michalec4d366372017-09-18 13:54:53 +020017 /srv/salt/scripts/bootstrap.sh &&\
18 if [[ -e /tmp/kitchen ]]; then sed -i '/BOOTSTRAP=/d' /kitchen.env; fi
Petr Michalec3ae395b2017-09-07 20:15:15 +020019fi
20
21# VERIFY
22export RECLASS_IGNORE_CLASS_NOTFOUND=False
23cd /srv/salt/reclass &&\
24if [[ -z "$1" ]] ; then
25 verify_salt_master &&\
26 verify_salt_minions
27else
28 verify_salt_minion "$1"
29fi