|
@ -4,8 +4,7 @@ |
|
|
VAGRANT_CONFIG_VERSION = "2" |
|
|
VAGRANT_CONFIG_VERSION = "2" |
|
|
|
|
|
|
|
|
Vagrant.configure(VAGRANT_CONFIG_VERSION) do |config| |
|
|
Vagrant.configure(VAGRANT_CONFIG_VERSION) do |config| |
|
|
# Using the "contrib" version for vboxsf module for synced folders |
|
|
|
|
|
config.vm.box = "debian/contrib-buster64" |
|
|
|
|
|
|
|
|
config.vm.box = "debian/bookworm64" |
|
|
|
|
|
|
|
|
# Main application folder |
|
|
# Main application folder |
|
|
config.vm.synced_folder "tildes/", "/opt/tildes/" |
|
|
config.vm.synced_folder "tildes/", "/opt/tildes/" |
|
@ -16,18 +15,11 @@ Vagrant.configure(VAGRANT_CONFIG_VERSION) do |config| |
|
|
config.vm.network "forwarded_port", guest: 9090, host: 9090 |
|
|
config.vm.network "forwarded_port", guest: 9090, host: 9090 |
|
|
|
|
|
|
|
|
config.vm.provision "ansible_local" do |ansible| |
|
|
config.vm.provision "ansible_local" do |ansible| |
|
|
|
|
|
ansible.install = true |
|
|
ansible.install_mode = "pip" |
|
|
ansible.install_mode = "pip" |
|
|
|
|
|
|
|
|
# Since Debian Buster still uses Python 2.7 by default and the pip bootstrap |
|
|
|
|
|
# script is no longer compatible with 2.7, we need to specify the installation |
|
|
|
|
|
# command manually. If we upgrade to a newer version of Debian that defaults to |
|
|
|
|
|
# Python 3.6+, this should no longer be necessary. |
|
|
|
|
|
ansible.pip_install_cmd = "sudo apt-get install -y python3-distutils && curl -s https://bootstrap.pypa.io/get-pip.py | sudo python3" |
|
|
|
|
|
|
|
|
|
|
|
# Vagrant doesn't currently recognize the new format for Ansible versions |
|
|
|
|
|
# (e.g. "ansible [core 2.11.1]"), so the compatibility mode is set incorrectly. |
|
|
|
|
|
# A new version of Vagrant should resolve this soon. |
|
|
|
|
|
ansible.compatibility_mode = "2.0" |
|
|
|
|
|
|
|
|
ansible.version = "10.6.0" |
|
|
|
|
|
ansible.pip_install_cmd = "sudo apt-get install -y python3-pip" |
|
|
|
|
|
ansible.pip_args = "--break-system-packages" |
|
|
|
|
|
|
|
|
# put the VM into the "dev" and "app_server" Ansible groups |
|
|
# put the VM into the "dev" and "app_server" Ansible groups |
|
|
ansible.groups = { |
|
|
ansible.groups = { |
|
@ -43,4 +35,19 @@ Vagrant.configure(VAGRANT_CONFIG_VERSION) do |config| |
|
|
vb.memory = "4096" |
|
|
vb.memory = "4096" |
|
|
vb.cpus = "4" |
|
|
vb.cpus = "4" |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
config.vm.provider "docker" do |d, override| |
|
|
|
|
|
# Docker does not require config.vm.box |
|
|
|
|
|
override.vm.box = nil |
|
|
|
|
|
# Instead, specify build_dir where Dockerfile is located. |
|
|
|
|
|
d.build_dir = "./docker" |
|
|
|
|
|
d.dockerfile = "Dockerfile-for-vagrant" |
|
|
|
|
|
|
|
|
|
|
|
# Keep Docker container running indefinitely |
|
|
|
|
|
d.remains_running = true |
|
|
|
|
|
d.create_args = ["--detach", "--tty"] |
|
|
|
|
|
|
|
|
|
|
|
# SSH configuration |
|
|
|
|
|
d.has_ssh = true |
|
|
|
|
|
end |
|
|
end |
|
|
end |