# frozen_string_literal: true # -*- mode: ruby -*- # vi: set ft=ruby : # install the vagrant-rancher provisioner plugin if # it is not already installed unless Vagrant.has_plugin?('vagrant-rancher') puts 'vagrant-rancher plugin not found, installing...' `vagrant plugin install vagrant-rancher` abort 'vagrant-rancher plugin installed, but you need to rerun the vagrant command' end Vagrant.configure('2') do |config| $rancher_version = 'v1.6.0' config.vm.box = 'ARTACK/debian-jessie' config.vm.provider 'virtualbox' do |v| v.memory = 1500 v.cpus = 2 v.customize ['modifyvm', :id, '--natdnshostresolver1', 'off'] end config.vm.define 'master' do |master| master.vm.hostname = 'master' master.vm.network 'private_network', ip: '192.168.123.11' master.vm.provision 'ansible' do |ansible| ansible.playbook = 'ansible/master.yml' # ansible.verbose = "vvv" end master.vm.provision :rancher do |rancher| rancher.role = 'server' rancher.version = $rancher_version rancher.hostname = '192.168.123.11' rancher.install_agent = false end end config.vm.define 'node01' do |node01| node01.vm.hostname = 'node01' node01.vm.network 'private_network', ip: '192.168.123.12' node01.vm.provision 'ansible' do |ansible| ansible.playbook = 'ansible/node.yml' end node01.vm.provision :rancher do |rancher| rancher.role = 'agent' rancher.hostname = '192.168.123.11' rancher.install_agent = true end end config.vm.define 'node02' do |node02| node02.vm.hostname = 'node02' node02.vm.network 'private_network', ip: '192.168.123.13' node02.vm.provision 'ansible' do |ansible| ansible.playbook = 'ansible/node.yml' end node02.vm.provision :rancher do |rancher| rancher.role = 'agent' rancher.hostname = '192.168.123.11' rancher.install_agent = true end end end