forked from garethr/puppet-docker-swarm-example
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
31 lines (25 loc) · 957 Bytes
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$instances = (ENV['INSTANCES'] || 2).to_i
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
$instances.times do |n|
id = n+1
ip = "10.20.3.1#{id}"
name = "swarm-#{id}"
config.vm.define name do |instance|
instance.vm.hostname = name
instance.vm.box = "ubuntu/bionic64"
instance.vm.provision :shell, :path => 'scripts/puppet.sh'
instance.vm.provision :hosts
instance.vm.provision :puppet do |puppet|
puppet.options = '--debug --verbose --summarize --reports store --hiera_config=/vagrant/hiera.yaml'
puppet.manifests_path = 'manifests'
puppet.module_path = [ 'modules', 'vendor/modules' ]
puppet.manifest_file = 'base.pp'
end
instance.vm.network "private_network", :ip => ip
end
end
end