Sha256: 31ee39c37999fe409c48ccc78dfc6dac3f9d1fbf37b59396f252687d06d37cd4

Contents?: true

Size: 1.89 KB

Versions: 1

Compression:

Stored size: 1.89 KB

Contents

# 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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rancher-api-beta-0.8.1 vagrant-rancher/Vagrantfile