2022-11-18 07:51:49 +00:00
|
|
|
# vi: set ft=ruby :
|
2019-01-02 05:04:01 +00:00
|
|
|
|
2022-11-18 07:51:49 +00:00
|
|
|
# Set PLAYBOOK shell var for ./dev/playbook.yml
|
|
|
|
PLAYBOOK=ENV["PLAYBOOK"]
|
|
|
|
if !PLAYBOOK
|
|
|
|
if File.exist?('.playbook')
|
|
|
|
PLAYBOOK = IO.read('.playbook').split("\n")[0]
|
|
|
|
end
|
2019-01-02 05:04:01 +00:00
|
|
|
|
2022-11-18 07:51:49 +00:00
|
|
|
if !PLAYBOOK || PLAYBOOK.empty?
|
|
|
|
PLAYBOOK = "webserver"
|
|
|
|
end
|
|
|
|
else
|
|
|
|
File.write(".playbook", PLAYBOOK)
|
|
|
|
end
|
2019-01-02 05:04:01 +00:00
|
|
|
|
2022-11-18 07:51:49 +00:00
|
|
|
# Debian 11
|
2019-01-02 05:04:01 +00:00
|
|
|
Vagrant.configure("2") do |config|
|
2022-11-18 07:51:49 +00:00
|
|
|
config.vm.box = "debian/bullseye64"
|
2019-01-02 05:04:01 +00:00
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
2022-11-18 07:51:49 +00:00
|
|
|
config.vm.network "private_network", type: "dhcp"
|
2019-01-24 00:28:21 +00:00
|
|
|
|
2019-01-02 05:04:01 +00:00
|
|
|
# Machine Name
|
|
|
|
config.vm.define :frita do |frita| #
|
|
|
|
end
|
|
|
|
|
2022-11-24 07:00:52 +00:00
|
|
|
# Set libvirt settings
|
2019-01-02 05:04:01 +00:00
|
|
|
config.vm.provider :libvirt do |libvirt|
|
2022-11-24 07:00:52 +00:00
|
|
|
libvirt.cpus = 2
|
|
|
|
libvirt.memory = 4096
|
2019-01-02 05:04:01 +00:00
|
|
|
libvirt.default_prefix = ""
|
|
|
|
end
|
|
|
|
|
2022-11-24 07:00:52 +00:00
|
|
|
# Set VirtualBox settings
|
|
|
|
config.vm.provider "virtualbox" do |vbox|
|
|
|
|
vbox.cpus = 2
|
|
|
|
vbox.memory = 4096
|
|
|
|
end
|
|
|
|
|
2019-01-02 05:04:01 +00:00
|
|
|
# Provision with Ansible
|
|
|
|
config.vm.provision "ansible" do |ansible|
|
2022-11-18 07:51:49 +00:00
|
|
|
ENV['ANSIBLE_ROLES_PATH'] = File.dirname(__FILE__) + "/roles"
|
2019-01-02 05:04:01 +00:00
|
|
|
ansible.compatibility_mode = "2.0"
|
2022-11-18 07:51:49 +00:00
|
|
|
ansible.playbook = "dev/" + PLAYBOOK + ".yml"
|
2019-01-02 05:04:01 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|