-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathVagrantfile
More file actions
38 lines (35 loc) · 2.39 KB
/
Vagrantfile
File metadata and controls
38 lines (35 loc) · 2.39 KB
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
32
33
34
35
36
37
38
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
required_plugins = %w(vagrant-scp vagrant-disksize vagrant-puppet-install vagrant-vbguest)
plugins_to_install = required_plugins.select { |plugin| not Vagrant.has_plugin? plugin }
if not plugins_to_install.empty?
puts "Installing plugins: #{plugins_to_install.join(' ')}"
if system "vagrant plugin install #{plugins_to_install.join(' ')}"
exec "vagrant #{ARGV.join(' ')}"
else
abort "Installation of one or more plugins has failed. Aborting."
end
end
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/xenial64'
config.disksize.size = '50GB'
config.vm.synced_folder '.', '/etc/puppetlabs/code/modules/quartermaster', :mount_options => ['dmode=775','fmode=777']
config.vm.synced_folder './files/hiera', '/etc/puppetlabs/code/environments/production/data', :mount_options => ['dmode=775','fmode=777']
config.vm.provider 'virtualbox' do |v|
v.customize ['modifyvm', :id, '--memory', '2048']
v.linked_clone = true
end
config.puppet_install.puppet_version = '5.5.7'
config.vm.provision 'shell', inline: '/opt/puppetlabs/puppet/bin/gem install r10k hiera-eyaml'
config.vm.provision 'shell', inline: 'apt-get update -y && apt-get -y install rsync curl wget git'
config.vm.provision 'shell', inline: 'curl -o /etc/puppetlabs/code/environments/production/Puppetfile https://raw.githubusercontent.com/ppouliot/puppet-quartermaster/master/Puppetfile'
config.vm.provision 'shell', inline: 'curl -o /etc/puppetlabs/code/environments/production/hiera.yaml https://raw.githubusercontent.com/ppouliot/puppet-quartermaster/master/files/hiera/hiera.yaml'
config.vm.provision 'shell', inline: 'curl -o /etc/puppetlabs/puppet/hiera.yaml https://raw.githubusercontent.com/ppouliot/puppet-quartermaster/master/files/hiera/hiera.yaml'
config.vm.provision 'shell', inline: 'cd /etc/puppetlabs/code/environments/production && /opt/puppetlabs/puppet/bin/r10k puppetfile install --verbose DEBUG2'
config.vm.provision 'shell', inline: '/opt/puppetlabs/bin/puppet module list --tree'
config.vm.provision 'shell', inline: '/opt/puppetlabs/bin/puppet apply --debug --trace --verbose --modulepath=/etc/puppetlabs/code/modules:/etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/code/modules /etc/puppetlabs/code/modules/quartermaster/examples/light.pp'
config.vm.define 'quartermaster' do |v|
v.vm.hostname = 'quartermaster.contoso.ltd'
end
end