Procházet zdrojové kódy

Merge pull request #53 from ZetaBit/vagrant

Vagrant
master
Nitin Madhok před 10 roky
rodič
revize
2013d4b499
6 změnil soubory, kde provedl 59 přidání a 1 odebrání
  1. +3
    -0
      .gitignore
  2. +10
    -1
      README.rst
  3. +24
    -0
      Vagrantfile
  4. +3
    -0
      dev/pillar_top.sls
  5. +14
    -0
      dev/setup-salt.sh
  6. +5
    -0
      dev/state_top.sls

+ 3
- 0
.gitignore Zobrazit soubor

@@ -0,0 +1,3 @@
.vagrant/
.idea/
top.sls

+ 10
- 1
README.rst Zobrazit soubor

@@ -55,4 +55,13 @@ Every option available in the templates can be set in pillar. Settings under 'sa

``Extending``
=============
Additional templates can be added by the user under salt/files/minion.d and master.d. This might be useful if, for example, a recently-added configuration option is not yet provided by the default template.
Additional templates can be added by the user under salt/files/minion.d and master.d. This might be useful if, for example, a recently-added configuration option is not yet provided by the default template.

``Vagrant``
===========

Executing the provided `Vagrantfile <http://www.vagrantup.com/>`_ will create a Ubuntu 14.04 VM, add the default Saltstack Repository and install the current stable version.

The folders inside the VM will be set up in a way that enables you to simply execute 'sudo salt "*" state.highstate' to apply the salt formula to the VM, using the pillar.example config. You can check /etc/salt/ for results.

Remember, you will have to run ``state.highstate`` or ``state.sls salt.(master|minion|cloud)`` manually.

+ 24
- 0
Vagrantfile Zobrazit soubor

@@ -0,0 +1,24 @@
# -*- 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.box = "ubuntu/trusty64"
config.vm.hostname = "salt"
config.vm.synced_folder "./", "/srv/salt", id: "vagrant-root"

config.ssh.forward_agent = true

config.vm.provider :virtualbox do |vb|
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end

# Set up salt-master and minion
config.vm.provision "shell", path: "dev/setup-salt.sh"
end

+ 3
- 0
dev/pillar_top.sls Zobrazit soubor

@@ -0,0 +1,3 @@
base:
'salt':
- salt

+ 14
- 0
dev/setup-salt.sh Zobrazit soubor

@@ -0,0 +1,14 @@
#!/bin/sh
sudo add-apt-repository ppa:saltstack/salt -y
sudo apt-get update -y
sudo apt-get install salt-master -y
sudo apt-get install salt-minion -y
# setup top files to test the formula
sudo mkdir -p /srv/pillar
sudo ln -s /srv/salt/pillar.example /srv/pillar/salt.sls
sudo ln -s /srv/salt/dev/pillar_top.sls /srv/pillar/top.sls
# this file will be copied to make a running config. it should not be checked in.
sudo cp /srv/salt/dev/state_top.sls /srv/salt/top.sls
# Accept all keys#
sleep 15 #give the minion a few seconds to register
sudo salt-key -y -A

+ 5
- 0
dev/state_top.sls Zobrazit soubor

@@ -0,0 +1,5 @@
base:
'salt':
- salt.master
- salt.minion
- salt.cloud

Načítá se…
Zrušit
Uložit