2019-09-17 22:32:08 -04:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
2021-04-15 02:43:24 -04:00
|
|
|
SSH_FORWARD=ENV["SSH_FORWARD"]
|
|
|
|
if !(SSH_FORWARD == "true")
|
|
|
|
SSH_FORWARD = false
|
|
|
|
end
|
2021-03-13 02:44:30 -05:00
|
|
|
|
2021-04-15 02:43:24 -04:00
|
|
|
PLAYBOOK=ENV["PLAYBOOK"]
|
2021-03-13 02:44:30 -05:00
|
|
|
if !PLAYBOOK
|
|
|
|
if File.exist?('.playbook')
|
|
|
|
PLAYBOOK = IO.read('.playbook').split("\n")[0]
|
|
|
|
end
|
|
|
|
|
|
|
|
if !PLAYBOOK || PLAYBOOK.empty?
|
|
|
|
PLAYBOOK = "\nERROR: Set env PLAYBOOK"
|
|
|
|
end
|
|
|
|
else
|
|
|
|
File.write(".playbook", PLAYBOOK)
|
|
|
|
end
|
|
|
|
|
2019-09-17 22:32:08 -04:00
|
|
|
Vagrant.configure("2") do |config|
|
2021-07-16 18:48:46 -04:00
|
|
|
config.vm.box = "debian/contrib-buster64"
|
2020-06-23 21:59:47 -04:00
|
|
|
config.vm.network "private_network", type: "dhcp"
|
2019-09-17 22:32:08 -04:00
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
2021-07-16 18:48:46 -04:00
|
|
|
config.vm.synced_folder "./scratch", "/vagrant/scratch"
|
2021-04-15 02:43:24 -04:00
|
|
|
config.ssh.forward_agent = SSH_FORWARD
|
2019-09-17 22:32:08 -04:00
|
|
|
|
|
|
|
# Machine Name
|
|
|
|
config.vm.define :moxie do |moxie| #
|
|
|
|
end
|
|
|
|
|
|
|
|
# Disable Machine Name Prefix
|
|
|
|
config.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.default_prefix = ""
|
|
|
|
end
|
|
|
|
|
2020-06-13 01:12:23 -04:00
|
|
|
config.vm.provider "virtualbox" do |vbox|
|
2021-06-21 22:36:35 -04:00
|
|
|
vbox.memory = 4096
|
2020-06-13 01:12:23 -04:00
|
|
|
end
|
|
|
|
|
2019-09-17 22:32:08 -04:00
|
|
|
# Provision with Ansible
|
|
|
|
config.vm.provision "ansible" do |ansible|
|
2020-06-14 22:33:39 -04:00
|
|
|
ENV['ANSIBLE_ROLES_PATH'] = File.dirname(__FILE__) + "/roles"
|
2019-09-17 22:32:08 -04:00
|
|
|
ansible.compatibility_mode = "2.0"
|
2021-03-13 02:44:30 -05:00
|
|
|
ansible.playbook = "dev/" + PLAYBOOK + ".yml"
|
2019-09-17 22:32:08 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|