Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | #export HOSTNAME=${`hostname -s`} |
| 4 | #export DOMAIN=${`hostname -d`} |
| 5 | cd /srv/salt/scripts; git pull -r || true; source bootstrap.sh || exit 1 |
| 6 | |
| 7 | # BOOTSTRAP |
| 8 | if [[ $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 Michalec | 4d36637 | 2017-09-18 13:54:53 +0200 | [diff] [blame] | 17 | /srv/salt/scripts/bootstrap.sh &&\ |
| 18 | if [[ -e /tmp/kitchen ]]; then sed -i '/BOOTSTRAP=/d' /kitchen.env; fi |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 19 | fi |
| 20 | |
| 21 | # VERIFY |
| 22 | export RECLASS_IGNORE_CLASS_NOTFOUND=False |
| 23 | cd /srv/salt/reclass &&\ |
| 24 | if [[ -z "$1" ]] ; then |
| 25 | verify_salt_master &&\ |
| 26 | verify_salt_minions |
| 27 | else |
| 28 | verify_salt_minion "$1" |
| 29 | fi |