浏览代码

Added a Vagrant setup to instantly test the formula

master
Martin Griesbach 10 年前
父节点
当前提交
862421e80f
共有 5 个文件被更改,包括 50 次插入0 次删除
  1. +3
    -0
      .gitignore
  2. +24
    -0
      Vagrantfile
  3. +3
    -0
      dev/pillar_top.sls
  4. +15
    -0
      dev/setup-salt.sh
  5. +5
    -0
      dev/state_top.sls

+ 3
- 0
.gitignore 查看文件

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

+ 24
- 0
Vagrantfile 查看文件

@@ -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 查看文件

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

+ 15
- 0
dev/setup-salt.sh 查看文件

@@ -0,0 +1,15 @@
#!/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
# Accept all keys#
sleep 5 #give the minion a few seconds to register
sudo salt-key -y -A
# 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


+ 5
- 0
dev/state_top.sls 查看文件

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

正在加载...
取消
保存