From 5da05f47bb5679de50827c11708490331898177e Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Tue, 17 Nov 2015 17:05:47 -0500 Subject: [PATCH 1/7] tests need ruby 2.1.1 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 7ec1d6d..3e3c2f1 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.0 +2.1.1 From 9644676f426559cf23036a52401a2b88b4086a38 Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 18 Nov 2015 06:38:44 -0500 Subject: [PATCH 2/7] issue #36 - add acceptance test for puppet4 environment use case --- spec/acceptance/skeletons/puppet4/Vagrantfile | 21 ++++++++++++++ .../environments/myenv/NOTmodules/.gitkeep | 0 .../puppet4/environments/myenv/Puppetfile | 12 ++++++++ .../environments/myenv/manifests/site.pp | 1 + .../environments/myenv/modules/.gitkeep | 0 spec/acceptance/skeletons/puppet4/gitcheck.sh | 20 +++++++++++++ .../vagrant-r10k/vagrant-r10k_spec.rb | 28 +++++++++++++++++++ 7 files changed, 82 insertions(+) create mode 100644 spec/acceptance/skeletons/puppet4/Vagrantfile create mode 100644 spec/acceptance/skeletons/puppet4/environments/myenv/NOTmodules/.gitkeep create mode 100644 spec/acceptance/skeletons/puppet4/environments/myenv/Puppetfile create mode 100644 spec/acceptance/skeletons/puppet4/environments/myenv/manifests/site.pp create mode 100644 spec/acceptance/skeletons/puppet4/environments/myenv/modules/.gitkeep create mode 100755 spec/acceptance/skeletons/puppet4/gitcheck.sh diff --git a/spec/acceptance/skeletons/puppet4/Vagrantfile b/spec/acceptance/skeletons/puppet4/Vagrantfile new file mode 100644 index 0000000..6638fc8 --- /dev/null +++ b/spec/acceptance/skeletons/puppet4/Vagrantfile @@ -0,0 +1,21 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +#require 'vagrant-vmware-workstation' +puts ENV + +Vagrant.configure("2") do |config| + config.vm.box = "vagrantr10kspec" + config.vm.network "private_network", type: "dhcp" + + # r10k plugin to deploy puppet modules + config.r10k.puppet_dir = "environments/myenv" + config.r10k.puppetfile_path = "environments/myenv/Puppetfile" + config.r10k.module_path = "environments/myenv/modules" + + # Provision the machine with the appliction + config.vm.provision "puppet" do |puppet| + puppet.environment = "myenv" + puppet.environment_path = "environments" + end +end diff --git a/spec/acceptance/skeletons/puppet4/environments/myenv/NOTmodules/.gitkeep b/spec/acceptance/skeletons/puppet4/environments/myenv/NOTmodules/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/spec/acceptance/skeletons/puppet4/environments/myenv/Puppetfile b/spec/acceptance/skeletons/puppet4/environments/myenv/Puppetfile new file mode 100644 index 0000000..489c10c --- /dev/null +++ b/spec/acceptance/skeletons/puppet4/environments/myenv/Puppetfile @@ -0,0 +1,12 @@ +# This is currently a noop but will be supported in the future. +forge 'forge.puppetlabs.com' + +# v1.0.1 -> cdb8d7a186846b49326cec1cfb4623bd77529b04 +mod 'reviewboard', + :git => 'https://github.com/jantman/puppet-reviewboard.git', + :ref => 'v1.0.1' + +# 0.1.0 -> 3a504b5f66ebe1853bda4ee065fce18118958d84 +mod 'nodemeister', + :git => 'https://github.com/jantman/puppet-nodemeister.git', + :ref => '0.1.0' diff --git a/spec/acceptance/skeletons/puppet4/environments/myenv/manifests/site.pp b/spec/acceptance/skeletons/puppet4/environments/myenv/manifests/site.pp new file mode 100644 index 0000000..247d872 --- /dev/null +++ b/spec/acceptance/skeletons/puppet4/environments/myenv/manifests/site.pp @@ -0,0 +1 @@ +notify {'vagrant-r10k puppet run': } diff --git a/spec/acceptance/skeletons/puppet4/environments/myenv/modules/.gitkeep b/spec/acceptance/skeletons/puppet4/environments/myenv/modules/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/spec/acceptance/skeletons/puppet4/gitcheck.sh b/spec/acceptance/skeletons/puppet4/gitcheck.sh new file mode 100755 index 0000000..effaf50 --- /dev/null +++ b/spec/acceptance/skeletons/puppet4/gitcheck.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# helper script to determine if a git clone is checked out to a +# PR, tag, or branch, and then output some information about the status +if [ $# -gt 0 ]; then + cd $1 +fi +origin=$(git remote show -n origin | grep 'Fetch URL:' | awk '{print $3}') +if tmp=$(git status | grep "refs/pull/origin"); then + foo=$(echo "$tmp" | awk '{print $4}' | awk -F / '{print $4}') + echo "PR: ${foo} @ $(git rev-parse HEAD) (origin: ${origin})" +elif tagname=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2>/dev/null); then + echo "tag: ${tagname} @ $(git rev-parse HEAD) (origin: ${origin})" +elif git symbolic-ref -q HEAD &>/dev/null; then + branch_name=$(git symbolic-ref -q HEAD) + branch_name=${branch_name##refs/heads/} + branch_name=${branch_name:-HEAD} + echo "branch: ${branch_name} @ $(git rev-parse HEAD) (origin: ${origin})" +else + echo "sha: $(git rev-parse HEAD) (origin: ${origin})" +fi diff --git a/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb b/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb index ab5cce9..1e0bb02 100644 --- a/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb +++ b/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb @@ -50,6 +50,34 @@ end end + describe 'configured correctly - puppet4 environment' do + before do + setup_before('puppet4', options) + end + after do + assert_execute("vagrant", "destroy", "--force") + end + + it 'deploys Puppetfile modules in an environment' do + status("Test: vagrant up") + up_result = assert_execute('vagrant', 'up', "--provider=#{provider}", '--debug') + ensure_successful_run(up_result, environment.workdir) + status("Test: reviewboard module") + rb_dir = File.join(environment.workdir, 'puppet', 'modules', 'reviewboard') + expect(File.directory?(rb_dir)).to be_truthy + rb_result = assert_execute('bash', 'gitcheck.sh', 'puppet/modules/reviewboard') + expect(rb_result).to exit_with(0) + expect(rb_result.stdout).to match(/tag: v1\.0\.1 @ cdb8d7a186846b49326cec1cfb4623bd77529b04 \(origin: https:\/\/github\.com\/jantman\/puppet-reviewboard\.git\)/) + + status("Test: nodemeister module") + nm_dir = File.join(environment.workdir, 'puppet', 'modules', 'nodemeister') + expect(File.directory?(nm_dir)).to be_truthy + nm_result = assert_execute('bash', 'gitcheck.sh', 'puppet/modules/nodemeister') + expect(nm_result).to exit_with(0) + expect(nm_result.stdout).to match(/tag: 0\.1\.0 @ 3a504b5f66ebe1853bda4ee065fce18118958d84 \(origin: https:\/\/github\.com\/jantman\/puppet-nodemeister\.git\)/) + end + end + describe 'destroy when configured correctly' do before do setup_before('correct', options) From 57523d5e41b0f6fecdaeade46506cd904f50d545 Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 18 Nov 2015 07:56:55 -0500 Subject: [PATCH 3/7] issue #36 - acceptance and unit tests for this issue --- lib/vagrant-r10k/helpers.rb | 4 +++- spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb | 2 +- spec/unit/helpers_spec.rb | 12 +++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/vagrant-r10k/helpers.rb b/lib/vagrant-r10k/helpers.rb index 78a0513..c13900d 100644 --- a/lib/vagrant-r10k/helpers.rb +++ b/lib/vagrant-r10k/helpers.rb @@ -123,8 +123,10 @@ def module_path(env, prov, env_dir_path) module_path = env[:machine].config.r10k.module_path if prov.config.module_path.is_a?(Array) and ! prov.config.module_path.include?(module_path) raise ErrorWrapper.new(RuntimeError.new("vagrant-r10k: module_path \"#{module_path}\" is not within the ones defined in puppet provisioner; please correct this condition")) + elsif prov.config.module_path.nil? + env[:ui].info "vagrant-r10k: Puppet provisioner module_path is nil, assuming puppet4 environment mode" elsif ! prov.config.module_path.is_a?(Array) and prov.config.module_path != module_path - raise ErrorWrapper.new(RuntimeError.new("vagrant-r10k: module_path \"#{module_path}\" is not the same as in puppet provisioner; please correct this condition")) + raise ErrorWrapper.new(RuntimeError.new("vagrant-r10k: module_path \"#{module_path}\" is not the same as in puppet provisioner (#{prov.config.module_path}); please correct this condition")) end # no modulepath explict set in config, build one from the provisioner config else diff --git a/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb b/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb index 1e0bb02..e2d6f12 100644 --- a/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb +++ b/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb @@ -131,7 +131,7 @@ status("Test: vagrant up") up_result = execute('vagrant', 'up', "--provider=#{provider}") expect(up_result).to exit_with(1) - expect(up_result.stderr).to match('RuntimeError: vagrant-r10k: module_path "puppet/NOTmodules" is not the same as in puppet provisioner; please correct this condition') + expect(up_result.stderr).to match(/RuntimeError: vagrant-r10k: module_path "puppet\/NOTmodules" is not the same as in puppet provisioner \(puppet\/modules\); please correct this condition/) ensure_r10k_didnt_run(up_result, environment.workdir) ensure_puppet_didnt_run(up_result) end diff --git a/spec/unit/helpers_spec.rb b/spec/unit/helpers_spec.rb index 31f23a8..3ad2ae5 100644 --- a/spec/unit/helpers_spec.rb +++ b/spec/unit/helpers_spec.rb @@ -284,7 +284,17 @@ env = {:machine => double, :ui => double} allow(env[:ui]).to receive(:info).with("vagrant-r10k: Building the r10k module path with puppet provisioner module_path \"\". (if module_path is an array, first element is used)") env[:machine].stub_chain(:config, :r10k, :module_path).and_return('r10kmodule/path') - expect { module_path(env, prov_dbl, '/env/dir/path') }.to raise_error(VagrantPlugins::R10k::Helpers::ErrorWrapper, /module_path "r10kmodule\/path" is not the same as in puppet provisioner; please correct this condition/) + expect { module_path(env, prov_dbl, '/env/dir/path') }.to raise_error(VagrantPlugins::R10k::Helpers::ErrorWrapper, /module_path "r10kmodule\/path" is not the same as in puppet provisioner \(module\/path\); please correct this condition/) + end + end + context 'config.r10k.module_path set and provisioner module_path nil' do + it 'returns the joined module_path' do + prov_dbl = double + prov_dbl.stub_chain(:config, :module_path).and_return(nil) + env = {:machine => double, :ui => double} + allow(env[:ui]).to receive(:info).with("vagrant-r10k: Puppet provisioner module_path is nil, assuming puppet4 environment mode") + env[:machine].stub_chain(:config, :r10k, :module_path).and_return('module/path') + expect(module_path(env, prov_dbl, '/env/dir/path')).to eq('/env/dir/path/module/path') end end end From e8c5f514efaf3caa615d70ee36e91180e612077d Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 18 Nov 2015 08:43:22 -0500 Subject: [PATCH 4/7] fixes #36 - tentative fix for this issue --- lib/vagrant-r10k/action/deploy.rb | 2 -- lib/vagrant-r10k/helpers.rb | 4 +-- .../vagrant-r10k/vagrant-r10k_spec.rb | 31 ++++++++++++------- spec/unit/action_deploy_spec.rb | 3 -- spec/unit/helpers_spec.rb | 3 -- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/lib/vagrant-r10k/action/deploy.rb b/lib/vagrant-r10k/action/deploy.rb index b83ceca..ff2df1b 100644 --- a/lib/vagrant-r10k/action/deploy.rb +++ b/lib/vagrant-r10k/action/deploy.rb @@ -29,8 +29,6 @@ def call(env) @logger.debug("vagrant::r10k::deploy: env_dir_path=#{config[:env_dir_path]}") @logger.debug("vagrant::r10k::deploy: puppetfile_path=#{config[:puppetfile_path]}") @logger.debug("vagrant::r10k::deploy: module_path=#{config[:module_path]}") - @logger.debug("vagrant::r10k::deploy: manifests=#{config[:manifests]}") - @logger.debug("vagrant::r10k::deploy: manifest_file=#{config[:manifest_file]}") @logger.debug("vagrant::r10k::deploy: puppet_dir=#{config[:puppet_dir]}") deploy(env, config) diff --git a/lib/vagrant-r10k/helpers.rb b/lib/vagrant-r10k/helpers.rb index c13900d..5c25e78 100644 --- a/lib/vagrant-r10k/helpers.rb +++ b/lib/vagrant-r10k/helpers.rb @@ -97,15 +97,13 @@ def puppet_provisioner(env) # # @return [Hash] def r10k_config(env) - ret = { :manifests => nil, :module_path => nil, :manifest_file => nil } + ret = { :module_path => nil } ret[:env_dir_path] = env_dir(env) ret[:puppetfile_path] = puppetfile_path(env) prov = puppet_provisioner(env) return nil if prov.nil? ret[:module_path] = module_path(env, prov, ret[:env_dir_path]) return nil if ret[:module_path].nil? - ret[:manifest_file] = File.join(ret[:env_dir_path], prov.config.manifest_file) - ret[:manifests] = File.join(ret[:env_dir_path], prov.config.manifests_path[1]) ret[:puppet_dir] = File.join(ret[:env_dir_path], env[:machine].config.r10k.puppet_dir) ret end diff --git a/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb b/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb index e2d6f12..00f74a8 100644 --- a/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb +++ b/spec/acceptance/vagrant-r10k/vagrant-r10k_spec.rb @@ -61,18 +61,21 @@ it 'deploys Puppetfile modules in an environment' do status("Test: vagrant up") up_result = assert_execute('vagrant', 'up', "--provider=#{provider}", '--debug') - ensure_successful_run(up_result, environment.workdir) + ensure_successful_run(up_result, environment.workdir, expect_building=false, moddir='environments/myenv/modules', pupfile='environments/myenv/Puppetfile', do_ensure_ran=false) + expect(up_result.stdout).to include('Running provisioner: puppet') + expect(up_result.stdout).to include('Running Puppet with environment myenv') + expect(up_result.stdout).to include('vagrant-r10k puppet run') status("Test: reviewboard module") - rb_dir = File.join(environment.workdir, 'puppet', 'modules', 'reviewboard') + rb_dir = File.join(environment.workdir, 'environments', 'myenv', 'modules', 'reviewboard') expect(File.directory?(rb_dir)).to be_truthy - rb_result = assert_execute('bash', 'gitcheck.sh', 'puppet/modules/reviewboard') + rb_result = assert_execute('bash', 'gitcheck.sh', 'environments/myenv/modules/reviewboard') expect(rb_result).to exit_with(0) expect(rb_result.stdout).to match(/tag: v1\.0\.1 @ cdb8d7a186846b49326cec1cfb4623bd77529b04 \(origin: https:\/\/github\.com\/jantman\/puppet-reviewboard\.git\)/) status("Test: nodemeister module") - nm_dir = File.join(environment.workdir, 'puppet', 'modules', 'nodemeister') + nm_dir = File.join(environment.workdir, 'environments', 'myenv', 'modules', 'nodemeister') expect(File.directory?(nm_dir)).to be_truthy - nm_result = assert_execute('bash', 'gitcheck.sh', 'puppet/modules/nodemeister') + nm_result = assert_execute('bash', 'gitcheck.sh', 'environments/myenv/modules/nodemeister') expect(nm_result).to exit_with(0) expect(nm_result.stdout).to match(/tag: 0\.1\.0 @ 3a504b5f66ebe1853bda4ee065fce18118958d84 \(origin: https:\/\/github\.com\/jantman\/puppet-nodemeister\.git\)/) end @@ -218,7 +221,7 @@ def setup_before(skel_name, options) end # checks for a successful up run with r10k deployment and puppet provisioning - def ensure_successful_run(up_result, workdir) + def ensure_successful_run(up_result, workdir, expect_building=true, moddir='puppet/modules', pupfile='puppet/Puppetfile', do_ensure_ran=true) expect(up_result).to exit_with(0) # version checks expect(up_result.stderr).to include('global: - r10k = 1.5.1') @@ -235,16 +238,20 @@ def ensure_successful_run(up_result, workdir) # modulegetter BEFORE ConfigValidate expect(up_result.stderr).to match(%r"(?!ConfigValidate)+default: vagrant-r10k: Deploy finished.*Vagrant::Action::Builtin::ConfigValidate"m), "modulegetter runs before ConfigValidate" # other checks - expect(up_result.stdout).to include('vagrant-r10k: Building the r10k module path with puppet provisioner module_path "puppet/modules"') - expect(up_result.stdout).to include("vagrant-r10k: Beginning r10k deploy of puppet modules into #{workdir}/puppet/modules using #{workdir}/puppet/Puppetfile") + if expect_building then + expect(up_result.stdout).to include('vagrant-r10k: Building the r10k module path with puppet provisioner module_path "puppet/modules"') + end + expect(up_result.stdout).to include("vagrant-r10k: Beginning r10k deploy of puppet modules into #{workdir}/#{moddir} using #{workdir}/#{pupfile}") expect(up_result.stdout).to include('vagrant-r10k: Deploy finished') # file tests - expect(File).to exist("#{workdir}/puppet/modules/reviewboard/Modulefile") - expect(File).to exist("#{workdir}/puppet/modules/nodemeister/Modulefile") - expect(File).to exist("#{workdir}/puppet/modules/nodemeister/manifests/init.pp") + expect(File).to exist("#{workdir}/#{moddir}/reviewboard/Modulefile") + expect(File).to exist("#{workdir}/#{moddir}/nodemeister/Modulefile") + expect(File).to exist("#{workdir}/#{moddir}/nodemeister/manifests/init.pp") # ensure puppet ran - ensure_puppet_ran(up_result) + if do_ensure_ran then + ensure_puppet_ran(up_result) + end end # ensure that r10k didnt run diff --git a/spec/unit/action_deploy_spec.rb b/spec/unit/action_deploy_spec.rb index d4d5f8b..6d21761 100644 --- a/spec/unit/action_deploy_spec.rb +++ b/spec/unit/action_deploy_spec.rb @@ -145,7 +145,6 @@ :puppetfile_path => 'puppetfile/path', :module_path => 'module/path', :manifests => 'manifests', - :manifest_file => 'manifest/file', :puppet_dir => 'puppet/dir', }} let(:pf_dbl) { double } @@ -184,8 +183,6 @@ expect(logger).to receive(:debug).once.ordered.with("vagrant::r10k::deploy: env_dir_path=env/dir/path") expect(logger).to receive(:debug).once.ordered.with("vagrant::r10k::deploy: puppetfile_path=puppetfile/path") expect(logger).to receive(:debug).once.ordered.with("vagrant::r10k::deploy: module_path=module/path") - expect(logger).to receive(:debug).once.ordered.with("vagrant::r10k::deploy: manifests=manifests") - expect(logger).to receive(:debug).once.ordered.with("vagrant::r10k::deploy: manifest_file=manifest/file") expect(logger).to receive(:debug).once.ordered.with("vagrant::r10k::deploy: puppet_dir=puppet/dir") expect(subject).to receive(:deploy).with(env, config).once expect(app).to receive(:call).once.with(env) diff --git a/spec/unit/helpers_spec.rb b/spec/unit/helpers_spec.rb index 3ad2ae5..75e899f 100644 --- a/spec/unit/helpers_spec.rb +++ b/spec/unit/helpers_spec.rb @@ -214,7 +214,6 @@ context 'no methods return nil' do before do prov_dbl = double - prov_dbl.stub_chain(:config, :manifest_file).and_return('manifest/file') prov_dbl.stub_chain(:config, :manifests_path).and_return([0, 'manifests/path']) allow_any_instance_of(VagrantPlugins::R10k::Helpers).to receive(:env_dir).and_return('/my/env/dir') allow_any_instance_of(VagrantPlugins::R10k::Helpers).to receive(:puppetfile_path).and_return('puppet/file/path') @@ -228,8 +227,6 @@ :env_dir_path => '/my/env/dir', :puppetfile_path => 'puppet/file/path', :module_path => 'module/path', - :manifest_file => '/my/env/dir/manifest/file', - :manifests => '/my/env/dir/manifests/path', :puppet_dir => '/my/env/dir/puppet/dir', }) end From 3eb2e1ec5876a19237268fedde0318387ebf6a2d Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 18 Nov 2015 09:10:42 -0500 Subject: [PATCH 5/7] issue #36 - add changelog for 0.4.1 --- CHANGES.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 5b23461..b3db1da 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,9 +2,13 @@ ## master (unreleased) +## 0.4.1 2015-11-18 Jason Antman + +* [#36](https://github.com/jantman/vagrant-r10k/issues/36) - Fix "no implicit conversion of nil into String" issue with puppet4, caused by ``config.r10k.manifest_file`` and/or ``config.r10k.manifests_path`` not being specified. This removes all use of these parameters, which were only used in log messages. It also removes validation that the Puppet provisioner's ``module_path`` matches that specified for r10k. + ## 0.4.0 2015-10-29 Jason Antman -* [#13]() / [PR #34/35](https://github.com/jantman/vagrant-r10k/pull/35) - Upgrade r10k dependency to 1.5.1 (thanks to [@cdenneen](https://github.com/cdenneen) for the work). +* [#13](https://github.com/jantman/vagrant-r10k/issues/13) / [PR #34/35](https://github.com/jantman/vagrant-r10k/pull/35) - Upgrade r10k dependency to 1.5.1 (thanks to [@cdenneen](https://github.com/cdenneen) for the work). ## 0.3.0 2015-09-04 Jason Antman From 65b7ed8b8737fa12dc68a3d54110aaf9ad9c0461 Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 18 Nov 2015 09:17:48 -0500 Subject: [PATCH 6/7] issue #36 - add puppet4 environment example to README --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 6ad9081..c9ead09 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,36 @@ The configuration for r10k and puppet would look like: puppet.module_path = ["puppet/modules", "puppet/vendor"] end +### Usage With Puppet4 Environment-Based Provisioner + +Puppet4 discontinues use of the ``manifest_file`` and ``manifests_path`` parameters, and also makes the ``module_path`` parameter optional +for Puppet. In cases where only ``environment`` and ``environment_path`` are specified, ``module_path`` will be parsed from the environment's +``environment.conf``. + +vagrant-r10k does not handle parsing ``environment.conf``; you __must__ still specify the ``module_path`` for r10k to deploy modules into. + +Here is an example Vagrantfile (taken from vagrant-r10k's [acceptance tests](https://github.com/jantman/vagrant-r10k/blob/master/spec/acceptance/skeletons/puppet4/Vagrantfile)) +for use with environment-based configuration. Note that ``config.r10k.module_path`` is still specified. You can see the directory structure of this example +[here](https://github.com/jantman/vagrant-r10k/tree/master/spec/acceptance/skeletons/puppet4). + +``` +Vagrant.configure("2") do |config| + config.vm.box = "vagrantr10kspec" + config.vm.network "private_network", type: "dhcp" + + # r10k plugin to deploy puppet modules + config.r10k.puppet_dir = "environments/myenv" + config.r10k.puppetfile_path = "environments/myenv/Puppetfile" + config.r10k.module_path = "environments/myenv/modules" + + # Provision the machine with the appliction + config.vm.provision "puppet" do |puppet| + puppet.environment = "myenv" + puppet.environment_path = "environments" + end +end +``` + ## Getting Help Bug reports, feature requests, and pull requests are always welcome. At this time, the From a72d93ac571d25eedde9a9d71b2360534b5c6dbd Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 18 Nov 2015 09:21:28 -0500 Subject: [PATCH 7/7] bump version to 1.4.1 --- lib/vagrant-r10k/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-r10k/version.rb b/lib/vagrant-r10k/version.rb index df75593..6ccab2a 100644 --- a/lib/vagrant-r10k/version.rb +++ b/lib/vagrant-r10k/version.rb @@ -1,6 +1,6 @@ module VagrantPlugins # hold version number constant module R10k - VERSION = "0.4.0" + VERSION = "0.4.1" end end