Last active
April 6, 2016 19:01
-
-
Save eykd/51e16df1712e034baf13aeada0c65e9d to your computer and use it in GitHub Desktop.
Revisions
-
eykd created this gist
Feb 19, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ .vagrant This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define :salt_testbed do |salt| # All Vagrant configuration is done here. The most common configuration # options are documented and commented below. For a complete reference, # please see the online documentation at vagrantup.com. # Every Vagrant virtual environment requires a box to build off of. salt.vm.box = "ubuntu/trusty64" # Share for masterless salt minion salt.vm.synced_folder "./", "/opt/salt" salt.vm.provision :shell, path: "provision_salt.sh", privileged: false end end This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ fileserver_backend: - roots file_client: local file_roots: base: - /opt/salt pillar_roots: base: - /srv This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ include: - nginx webapps-group: group.present: - name: webapps - addusers: - www-data - require: - pkg: nginx This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ nginx: pkg.installed www-data: user.present: - require: - pkg: nginx This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/sh start_seconds="$(date +%s)" if [ ! -d "/etc/salt" ]; then echo "Bootstrap salt" sudo wget -O /root/install_salt.sh https://bootstrap.saltstack.com sudo sh /root/install_salt.sh -P git v2015.8.8 fi sudo mkdir -p /etc/salt sudo cp /vagrant/minion.conf /etc/salt/minion echo "Restart salt-minion" sudo salt-minion -d sudo service salt-minion restart echo "Executing salt highstate (provisioning)" sudo salt-call state.highstate end_seconds="$(date +%s)" echo "-----------------------------" echo "Provisioning complete in "$(expr $end_seconds - $start_seconds)" seconds" This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ base: '*': - nginx - my-env