|
| 1 | +# -*- mode: ruby -*- |
| 2 | +# vi: set ft=ruby : |
| 3 | + |
| 4 | +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! |
| 5 | +VAGRANTFILE_API_VERSION = "2" |
| 6 | + |
| 7 | +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 8 | + |
| 9 | + config.vm.box = ENV.fetch("VAGRANT_BOX", "ubuntu/trusty64") |
| 10 | + |
| 11 | + { |
| 12 | + "binder-local" => { |
| 13 | + "ip" => "192.168.168.195", |
| 14 | + "memory" => "2048", |
| 15 | + "cpus" => "2", |
| 16 | + }, |
| 17 | + }.each do |short_name, properties| |
| 18 | + |
| 19 | + # Define guest |
| 20 | + config.vm.define short_name do |host| |
| 21 | + host.vm.network "private_network", ip: properties.fetch("ip") |
| 22 | + host.vm.hostname = "#{short_name}.myapp.dev" |
| 23 | + end |
| 24 | + |
| 25 | + # Set the amount of RAM and virtual CPUs for the virtual machine |
| 26 | + config.vm.provider :virtualbox do |vb| |
| 27 | + vb.customize ["modifyvm", :id, "--memory", properties.fetch("memory")] |
| 28 | + vb.customize ["modifyvm", :id, "--cpus", properties.fetch("cpus")] |
| 29 | + end |
| 30 | + |
| 31 | + end |
| 32 | + |
| 33 | + config.vm.synced_folder "src/atom", "/usr/share/nginx/atom", create: true |
| 34 | + |
| 35 | + # Ansible provisioning |
| 36 | + config.vm.provision :ansible do |ansible| |
| 37 | + ansible.playbook = "./singlenode-qa.yml" |
| 38 | + ansible.host_key_checking = false |
| 39 | + ansible.extra_vars = { |
| 40 | + "atom_user" => "vagrant", |
| 41 | + "atom_group" => "vagrant", |
| 42 | + "atom_environment_type" => "development", |
| 43 | + "atom_flush_data" => "yes", |
| 44 | + "elasticsearch_network_bind_host" => "0.0.0.0", |
| 45 | + "es_config" => { |
| 46 | + "network.host" => "0.0.0.0", |
| 47 | + } |
| 48 | + } |
| 49 | + ansible.verbose = 'v' |
| 50 | + ansible.raw_arguments = ENV['ANSIBLE_ARGS'] |
| 51 | + end |
| 52 | + |
| 53 | +end |
0 commit comments