scullery/tests/scripts/bootstrap_salt.sh
Georg Pfuetzenreuter 00c9634579
Implement Salt tests
- test state application on minions
- add Salt file/pillar root bootstrap script
- add Salt state and pillar
- adjust configuration files respectively

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-05-21 11:00:35 +02:00

28 lines
484 B
Bash

testbase='/vagrant/tests/salt/hello_world'
sls='hello_world.sls'
ln -s "$testbase/states/$sls" /srv/salt/
ln -s "$testbase/pillar/$sls" /srv/pillar/
tee /srv/pillar/top.sls >/dev/null <<EOF
base:
'*':
- hello_world
EOF
if systemctl is-enabled salt-master
then
count=0
until salt -t10 scullery-\* test.ping
do
if [ "$count" = 3 ]
then
logger -s 'No minions connected'
break
fi
echo 'Waiting for minions to connect ...'
sleep 5
count=$((count+1))
done
fi