Created
January 21, 2018 21:46
-
-
Save meganlkm/65dc23ee5684a07f755982c3eea27b8a to your computer and use it in GitHub Desktop.
setup a salt-master and some minions for salt development and testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# clone the minions branch of the allsalt repo | |
git clone -b minions [email protected]:intuitivetechnologygroup/allsalt.git | |
# build the containers | |
cd allsalt | |
make build-debian | |
make build-centos-minion | |
make build-ubuntu-minion | |
# ----------------------------------------------------------------------------- | |
# create srv and master.d directories for the master container volumes | |
mkdir srv master.d | |
# start the salt-master | |
docker run -d --rm \ | |
-v $(pwd)/srv:/srv \ | |
-v $(pwd)/master.d:/etc/salt/master.d \ | |
-h dev-salt-master \ | |
--name dev-salt-master \ | |
simplyadrian/allsalt:debian_jessie | |
# docker exec -it dev-salt-master bash | |
# docker restart dev-salt-master | |
# docker kill dev-salt-master | |
# ----------------------------------------------------------------------------- | |
# start the ubuntu minion | |
docker run -d --rm \ | |
-h dev-ubuntu-minion-01 \ | |
--name dev-ubuntu-minion-01 \ | |
simplyadrian/allsalt/minion:ubuntu_latest | |
# docker exec -it dev-ubuntu-minion-01 bash | |
# docker restart dev-ubuntu-minion-01 | |
# docker kill dev-ubuntu-minion-01 | |
# ----------------------------------------------------------------------------- | |
# start the centos minion | |
docker run -d --rm \ | |
-h dev-centos-minion-01 \ | |
--name dev-centos-minion-01 \ | |
simplyadrian/allsalt/minion:centos7 | |
# docker exec -it dev-centos-minion-01 bash | |
# docker restart dev-centos-minion-01 | |
# docker kill dev-centos-minion-01 | |
# ----------------------------------------------------------------------------- | |
# open a bash session to the master and make sure the minion keys were accepted | |
docker exec -it dev-salt-master bash | |
salt-keys | |
# look at the os grains for each minion | |
salt \* grains.item os |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment