Created
April 25, 2017 07:09
-
-
Save digitalformula/4f8ad336f42df524e375d419f400ce5d to your computer and use it in GitHub Desktop.
SaltStack & Nginx Webserver Bootstrap
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
#!/bin/bash | |
# download and run the SaltStack bootstrap installer | |
curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com | |
sh bootstrap-salt.sh git develop | |
# stop the salt-minion service in preparation for reconfiguration | |
systemctl stop salt-minion | |
# create the required directory for Salt state files to live | |
mkdir /srv/salt | |
# download and unzip the Nginx webserver Salt state files | |
wget https://github.com/digitalformula/salt-nginx-webserver/archive/master.zip | |
unzip ./master.zip | |
# move the Nginx webserver Salt state files into place | |
mv ./salt-nginx-webserver-master/* /srv/salt | |
# reconfigure the salt-minion service to run as a 'Masterless Minion' | |
sed -i -- 's/#file_client: remote/file_client: local/' /etc/salt/minion | |
# restart and enable the salt-minion service after reconfiguration | |
systemctl start salt-minion.service | |
systemctl enable salt-minion.service | |
# download and run the Nginx repo install script | |
curl 'https://setup.ius.io/' -o setup-ius.sh | |
bash setup-ius.sh | |
# run the Salt states | |
echo "Running final Salt States ..." | |
salt-call --local state.highstate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment