This a boilerplate Vagrant environment ready to test Saltstack formulas.
In a previous incarnation of this repo I went for a multi-VM environment with a saltmaster and several minions. Now I simplified it assuming a master-less conf to try formulas.
I predefined four flavors of minion:
ubuntu1204
: Ubuntu 12.04 LTS with IP addresses 192.168.56.20/24 and 172.16.32.20/24ubuntu1404
: Ubuntu 14.04 LTS with IP addresses 192.168.56.21/24 and 172.16.32.21/24centos65
: CentOS 6.5 with IP addresses 192.168.56.22/24 and 172.16.32.22/24centos7rc
: CentOS 7.0rc with IP addresses 192.168.56.23/24 and 172.16.32.23/24 (This box has some problems so YMMV)
I'm not a Ruby literate so the Vagrantfile
could be improved to make it more
flexible, but so far it works for me :-)
The usage is fairly simple:
- Clone this repository.
- Install Vagrant in your system (if you don't have it already) along with VirtualBox.
- Put your formulas under
saltstack/salt-formulas
making sure that the name of the directory matches*-formula
(e.g.zabbix-saltstack-formula
orapache-formula
). You could even clone those formulas from their original repository using git subtree. For those formulas to be included you have to edit the file_roots of your /etc/salt/minion. - Put your states
top.sls
file and specific non-formulaic files undersaltstack/salt
- Put your pillar
top.sls
file undersaltstack/pillar
- Execute
vagrant up name-of-the-VM
and wait till it's up and running (could take a little while if you have to download the necessary vagrant box, but this is just the first time) - Execute
vagrant ssh name-of-the-VM
and you're ready to manage each one of the VMs
Of course, you can destroy, halt and provision the virtual machines at will. You can find all the documentation about Vagrant here.
I decided to include a set of formulas under saltstack/salt-formulas
to make
easier to try and develop them. All the subdirectories are actually git subtrees
coming from other repos.
The info about the exact remote origins for those subtrees could be seen in the
files remotes.txt
and subtrees.txt
. Those files could be used with the
scripts under the scripts/
directory.
Pay attention that it's up to you to include those formulas in the
root_files
configuration of your salt-minion or salt-master.