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
|
|
|
|
|
|
|
|
# Disable Machine Name Prefix
|
|
|
|
config.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.default_prefix = ""
|
|
|
|
end
|
|
|
|
|
|
|
|
# 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
|