Skip to content

Instantly share code, notes, and snippets.

Created Feb 11, 2015
What would you like to do?
from fabric.api import *
import time
def bootstrap_salt_master():
sudo('add-apt-repository ppa:saltstack/salt -y')
sudo('apt-get update -y')
sudo('apt-get install salt-minion -y')
sudo('apt-get install salt-master -y')
sudo('apt-get upgrade -y')
ssh_files = [
for file in ssh_files:
put(file, file, use_sudo=True)
sudo("chmod 400 %s" % file)
sudo("chown root %s" % file)
etc_files = [
for file in etc_files:
put(file, file, use_sudo=True)
sudo("chmod 644 %s" % file)
sudo("chown root %s" % file)
sudo('service salt-master restart')
sudo('service salt-minion restart')
sudo('salt-key -A -y')
sudo('salt-run fileserver.update')
sudo('salt-call saltutil.refresh_pillar')
sudo('salt-call state.highstate')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment