Sam A.
a67d82ad88
- Always use the new port if the VM is already provisioned - We're not using a multi-VM setup, so no need to define VM "datacoop" - Increase minimum required Vagrant version - Add static IP for hopefully implementing some sort of DNS in the future - Hardcode registry domain to use the real registry in Vagrant
37 lines
924 B
Ruby
37 lines
924 B
Ruby
Vagrant.require_version ">= 2.0.0"
|
|
PORT = 19022
|
|
|
|
def provisioned?(vm="default", provider="virtualbox")
|
|
File.exist?(".vagrant/machines/#{vm}/#{provider}/action_provision")
|
|
end
|
|
|
|
Vagrant.configure(2) do |config|
|
|
config.vm.network :private_network, ip: "192.168.56.10"
|
|
config.vm.network :forwarded_port, guest: PORT, host: PORT
|
|
|
|
config.vm.box = "ubuntu/focal64"
|
|
config.vm.hostname = "datacoop"
|
|
|
|
config.vm.provider :virtualbox do |v|
|
|
v.memory = 4096
|
|
end
|
|
|
|
config.vm.provision :ansible do |ansible|
|
|
ansible.compatibility_mode = "2.0"
|
|
ansible.playbook = "playbook.yml"
|
|
ansible.ask_vault_pass = true
|
|
ansible.verbose = "v"
|
|
ansible.extra_vars = {
|
|
base_domain: "datacoop.devel"
|
|
}
|
|
|
|
# If the VM is already provisioned, we need to use the new port
|
|
if provisioned?
|
|
config.ssh.guest_port = PORT
|
|
ansible.extra_vars = {
|
|
ansible_port: PORT
|
|
}
|
|
end
|
|
end
|
|
end
|