2 Commits

Vendored
+8 -23
View File
@@ -1,26 +1,25 @@
# vi: set ft=ruby : # vi: set ft=ruby :
# Set PLAYBOOK shell var for ./dev/playbook.yml # Set PLAYBOOK shell var for ./dev/playbook.yml
PLAYBOOK=ENV["PLAYBOOK"] playbook=ENV["PLAYBOOK"]
if !PLAYBOOK if !playbook
if File.exist?('.playbook') if File.exist?('.playbook')
PLAYBOOK = IO.read('.playbook').split("\n")[0] playbook = IO.read('.playbook').split("\n")[0]
end end
if !PLAYBOOK || PLAYBOOK.empty? if !playbook || playbook.empty?
PLAYBOOK = "webserver" playbook = "webserver"
end end
else else
File.write(".playbook", PLAYBOOK) File.write(".playbook", playbook)
end end
# Optionally allow more verbosity in Ansible # Optionally allow more verbosity in Ansible
VAGRANT_ANSIBLE_VERBOSE=ENV["VAGRANT_ANSIBLE_VERBOSE"] || false VAGRANT_ANSIBLE_VERBOSE=ENV["VAGRANT_ANSIBLE_VERBOSE"] || false
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
config.vm.box = "rockylinux/9" config.vm.box = "krislamo.org/rocky10"
config.vm.hostname = "fritadev" config.vm.hostname = "fritadev"
config.vm.disk :disk, size: "100GB", primary: true
config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.network "private_network", type: "dhcp" config.vm.network "private_network", type: "dhcp"
@@ -33,7 +32,6 @@ Vagrant.configure("2") do |config|
libvirt.cpus = 2 libvirt.cpus = 2
libvirt.memory = 4096 libvirt.memory = 4096
libvirt.default_prefix = "" libvirt.default_prefix = ""
libvirt.machine_virtual_size = 100
end end
# Set VirtualBox settings # Set VirtualBox settings
@@ -42,24 +40,11 @@ Vagrant.configure("2") do |config|
vbox.memory = 4096 vbox.memory = 4096
end end
# Expand XFS rootfs
config.vm.provision "shell", inline: <<-SHELL
set -xe
df -h /
dnf install -y cloud-utils-growpart
PART="$(findmnt -n -o SOURCE /)"
DISK="$(lsblk -n -o PKNAME "$PART")"
NUM="$(lsblk -n -o KNAME "$PART" | sed 's/.*[^0-9]//')"
growpart "/dev/$DISK" "$NUM" && \
xfs_growfs /
df -h /
SHELL
# Provision with Ansible # Provision with Ansible
config.vm.provision "ansible" do |ansible| config.vm.provision "ansible" do |ansible|
ENV['ANSIBLE_ROLES_PATH'] = File.dirname(__FILE__) + "/roles" ENV['ANSIBLE_ROLES_PATH'] = File.dirname(__FILE__) + "/roles"
ansible.compatibility_mode = "2.0" ansible.compatibility_mode = "2.0"
ansible.playbook = "dev/" + PLAYBOOK + ".yml" ansible.playbook = "dev/" + playbook + ".yml"
ansible.verbose = VAGRANT_ANSIBLE_VERBOSE ansible.verbose = VAGRANT_ANSIBLE_VERBOSE
end end
end end