Skip to content

Instantly share code, notes, and snippets.

@bvcelari
Created December 2, 2017 16:56
Show Gist options
  • Save bvcelari/10e0b2de0ce25243a89eeb22cc81275a to your computer and use it in GitHub Desktop.
Save bvcelari/10e0b2de0ce25243a89eeb22cc81275a to your computer and use it in GitHub Desktop.
#pre-requisites...
apt-get install -y openssh-server vim git virtualenv
#####required for docker states... should not be needed, but there is something broken in the salt repo...
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
######## Should work from the state, but does not :/
#Install salt
wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main" > /etc/apt/sources.list.d/saltstack.list
#get docker provisioning states
mkdir /opt/DockerHost/
cd /opt/DockerHost/
git clone https://github.com/bvcelari/docker-formula.git
virtualenv .
source bin/activate
cd docker-formula
pip install -r requirements.txt
#install salt master and minion... many ways to do this... this it's just fast
apt-get update
apt-get install -y salt-master
apt-get install -y salt-minion
echo "file_client: local
file_roots:
base:
- /opt/DockerHost/docker-formula" > /etc/salt/minion
echo "base:
'*':
- docker" > /opt/DockerHost/docker-formula/top.sls
service salt-minion restart
#and.. there is something broken in the image of ubuntu I am using... but sources it's breaking my installation... I am gonna remove the file
salt-call state.highstate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment