Add a Vagrantfile for testing

This commit is contained in:
Victor LABORIE 2018-04-11 14:32:45 +02:00
parent d6469e4e5b
commit 8263ca83e2
2 changed files with 28 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.vagrant

27
Vagrantfile vendored Normal file
View File

@ -0,0 +1,27 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
# Load ~/.VagrantFile if exist, permit local config provider
vagrantfile = File.join("#{Dir.home}", '.VagrantFile')
load File.expand_path(vagrantfile) if File.exists?(vagrantfile)
Vagrant.configure('2') do |config|
config.vm.synced_folder "./", "/vagrant", type: "rsync", rsync__exclude: [ '.vagrant', '.git' ]
$deps = <<SCRIPT
mkdir -p /etc/shellpki
id shellpki 2>&1 >/dev/null || useradd shellpki --system -M --home-dir /etc/shellpki --shell /usr/sbin/nologin
ln -sf /vagrant/openssl.cnf /etc/shellpki/
ln -sf /vagrant/shellpki.sh /usr/local/sbin/shellpki
SCRIPT
config.vm.define :shellpki do |node|
node.vm.hostname = "shellpki"
node.vm.box = "debian/stretch64"
node.vm.provision "deps", type: "shell", :inline => $deps
end
end