-
Notifications
You must be signed in to change notification settings - Fork 194
/
Vagrantfile
42 lines (37 loc) · 1.42 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile for bootstrapping a development Vault cluster with
# VirtualBox provider and Ansible provisioner
ANSIBLE_PLAYBOOK = ENV['ANSIBLE_PLAYBOOK'] || "site.yml"
BOX_MEM = ENV['BOX_MEM'] || "2048"
BOX_NAME = ENV['BOX_NAME'] || "debian/buster64"
VAULT_HOSTS = ENV['VAULT_HOSTS'] || "vagrant_hosts"
LOGLEVEL = ENV['VAULT_LOGLEVEL'] || "info"
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Configure one Vault server
config.vm.define :vault do |vault_config|
vault_config.vm.box = BOX_NAME
vault_config.vm.network :private_network, ip: "10.1.42.240"
vault_config.vm.hostname = "vault.local"
vault_config.ssh.forward_agent = true
vault_config.vm.provider "virtualbox" do |v|
v.name = "vault-server"
v.customize ["modifyvm", :id, "--memory", BOX_MEM]
v.customize ["modifyvm", :id, "--ioapic", "on"]
v.customize ["modifyvm", :id, "--cpus", "2"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
vault_config.vm.provision :ansible do |ansible|
ansible.inventory_path = VAULT_HOSTS
# Extra Ansible variables can be defined here
ansible.extra_vars = {
vault_log_level: LOGLEVEL
}
ansible.playbook = ANSIBLE_PLAYBOOK
ansible.limit = "all"
end
end
end