2018-06-23 23:44:30 +00:00
|
|
|
Vagrant.require_version ">= 1.7.0"
|
2022-11-17 07:53:45 +00:00
|
|
|
PORT = 19022
|
2018-06-23 23:44:30 +00:00
|
|
|
Vagrant.configure(2) do |config|
|
2022-11-17 07:53:45 +00:00
|
|
|
config.vm.network :forwarded_port, guest: PORT, host: PORT, id: "new_ssh"
|
|
|
|
# If we are trying to SSH into the VM, we need to use the new port
|
|
|
|
if ARGV[0] == "ssh"
|
|
|
|
config.ssh.guest_port = PORT
|
|
|
|
end
|
2018-06-23 23:44:30 +00:00
|
|
|
config.vm.define "datacoop" do |datacoop|
|
2022-11-13 21:04:37 +00:00
|
|
|
datacoop.vm.box = "ubuntu/focal64"
|
2018-06-23 23:44:30 +00:00
|
|
|
datacoop.vm.hostname = "datacoop"
|
|
|
|
datacoop.vm.provider "virtualbox" do |v|
|
|
|
|
v.memory = 4096
|
|
|
|
end
|
|
|
|
datacoop.vm.provision "ansible" do |ansible|
|
|
|
|
ansible.compatibility_mode = "2.0"
|
|
|
|
ansible.playbook = "playbook.yml"
|
2019-02-09 14:00:15 +00:00
|
|
|
ansible.ask_vault_pass = true
|
2022-11-13 21:04:37 +00:00
|
|
|
ansible.verbose = "v"
|
2022-11-17 07:53:45 +00:00
|
|
|
# If we are running the provision command, then we override the ansible_port
|
|
|
|
if ARGV[0] == "provision"
|
|
|
|
ansible.host_vars = {
|
|
|
|
"datacoop" => {
|
|
|
|
"ansible_port" => PORT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
2018-06-23 23:44:30 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|