Skip to content

Instantly share code, notes, and snippets.

@pau
Created July 16, 2012 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pau/3121231 to your computer and use it in GitHub Desktop.
Save pau/3121231 to your computer and use it in GitHub Desktop.
Building and Running Salt
vagrant@lucid32$ cd ~
vagrant@lucid32$ mkdir virtualenvs
vagrant@lucid32$ cd virtualenvs
vagrant@lucid32$ virtualenv salt-dev
vagrant@lucid32$ . salt-dev/bin/activate
(salt-dev)vagrant@lucid32$ cd ~
(salt-dev)vagrant@lucid32$ sudo aptitude install swig g++ python-dev uuid-dev make
(salt-dev)vagrant@lucid32$ wget http://download.zeromq.org/zeromq-2.2.0.tar.gz
(salt-dev)vagrant@lucid32$ tar xzvf zeromq-2.2.0.tar.gz
(salt-dev)vagrant@lucid32$ cd zeromq-2.2.0/
(salt-dev)vagrant@lucid32$ ./configure
(salt-dev)vagrant@lucid32$ make
(salt-dev)vagrant@lucid32$ sudo make install
(salt-dev)vagrant@lucid32$ cd ..
(salt-dev)vagrant@lucid32$ git clone https://github.com/saltstack/salt.git salt-dev
(salt-dev)vagrant@lucid32$ pip install -e salt-dev/
(salt-dev)vagrant@lucid32$ cp salt-dev/conf/master.template master
(salt-dev)vagrant@lucid32$ cp salt-dev/conf/minion.template minion
# Set master user and root_dir.
(salt-dev)vagrant@lucid32$ cat master | grep user:
user: vagrant
(salt-dev)vagrant@lucid32$ cat master | grep root_dir:
root_dir: /home/vagrant/virtualenvs/salt-dev
# Set minion master, user, root_dir and id.
(salt-dev)vagrant@lucid32$ cat minion | grep master:
master: localhost
(salt-dev)vagrant@lucid32$ cat minion | grep user:
user: vagrant
(salt-dev)vagrant@lucid32$ cat minion | grep root_dir:
root_dir: /home/vagrant/virtualenvs/salt-dev
(salt-dev)vagrant@lucid32$ cat minion | grep id:
id: salt-dev
# Note that salt-master and salt-minion has a -d option to run the process as a daemon but when I did that the minion key didn't show up in salt-key.
# Start master process.
(salt-dev)vagrant@lucid32$ salt-master -c master
# Start minion process. Need to open another vagrant ssh session and activate salt-dev virtualenv.
(salt-dev)vagrant@lucid32$ salt-minion -c minion
# Accept key and test. Need to open another vagrant ssh session and activate salt-dev virtualenv.
(salt-dev)vagrant@lucid32$ salt-key -c master
Unaccepted Keys:
salt-dev
Accepted Keys:
Rejected:
(salt-dev)vagrant@lucid32$ salt-key -c master -a salt-dev
Key for salt-dev accepted.
(salt-dev)vagrant@lucid32$ salt -c master salt-dev test.ping
salt-dev: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment