Last active
April 6, 2016 19:01
-
-
Save eykd/51e16df1712e034baf13aeada0c65e9d to your computer and use it in GitHub Desktop.
Demonstrating a bug in salt: user.present state removes all group membership if no groups argument provided
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 characters
.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 characters
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 characters
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 characters
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 characters
#!/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 characters
base: | |
'*': | |
- nginx | |
- my-env |
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 characters
# -*- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment