Skip to content

Instantly share code, notes, and snippets.

@eykd
Last active December 8, 2015 16:45
Show Gist options
  • Save eykd/2fc7bb012290ed4fbec8 to your computer and use it in GitHub Desktop.
Save eykd/2fc7bb012290ed4fbec8 to your computer and use it in GitHub Desktop.
Demonstrating an unintentional recursive requisite when two states have the same `name`.
fileserver_backend:
- roots
file_client: local
file_roots:
base:
- /opt/salt
pillar_roots:
base:
- /srv
include:
- virtualenv
my-env:
virtualenv.managed:
- name: /opt/my-env
- cwd: /opt/my-env
- require:
- pip: virtualenv
pip-local:
pip.installed:
- name: pip
- upgrade: true
- bin_env: /opt/my-env
- cwd: /opt/my-env
- require:
- virtualenv: my-env
pip:
pip.installed:
- upgrade: true
#!/bin/sh
start_seconds="$(date +%s)"
if [ ! -d "/etc/salt" ]; then
echo "Bootstrap salt"
wget -O install_salt.sh https://bootstrap.saltstack.com
sudo sh install_salt.sh -P git v2015.8.3
fi
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 (provisionning)"
sudo salt-call state.highstate
end_seconds="$(date +%s)"
echo "-----------------------------"
echo "Provisioning complete in "$(expr $end_seconds - $start_seconds)" seconds"
base:
'*':
- my-env
# -*- 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 :web do |web|
# 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.
web.vm.box = "ubuntu/trusty64"
# Share for masterless salt minion
web.vm.synced_folder "./", "/opt/salt"
web.vm.provision :shell, path: "provision_salt.sh", privileged: false
end
end
include:
- pip
virtualenv:
pip.installed:
- upgrade: true
- require:
- pip: pip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment