Skip to content

Commit

Permalink
Merge pull request #5 from /issues/3
Browse files Browse the repository at this point in the history
Issues/3
  • Loading branch information
jantman committed Jan 10, 2015
2 parents aede941 + f402dc6 commit 66f3ba6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 24 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Add unit tests for modulegetter and config.
* Readme updates.
* Add changelog.
* Fix bug in newer Vagrant where provider does not have .name ([issue #3](https://github.com/jantman/vagrant-r10k/issues/3))
* Update README.md

## 0.1.1 2014-08-07 Jason Antman <[email protected]>

Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ The configuration for r10k and puppet would look like:
1. Fork it ( https://github.com/jantman/vagrant-r10k/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Increment the version number in `lib/vagrant-r10k/version.rb`
5. Add yourself to the "Contributors" list below.
6. Push to the branch (`git push origin my-new-feature`)
7. Create a new Pull Request
4. Add yourself to the "Contributors" list below.
5. Push to the branch (`git push origin my-new-feature`)
6. Create a new Pull Request

### Contributors

Expand All @@ -129,6 +128,15 @@ to the above command).

Exporting ``VAGRANT_LOG=debug`` will also turn on debug-level logging for r10k.

## Releasing

1. Ensure all tests are passing, coverage is acceptable, etc.
2. Increment the version number in ``lib/vagrant-r10k/version.rb``
3. Update CHANGES.md
4. Push those changes to origin.
5. ``bundle exec rake build``
6. ``bundle exec rake release``

## Acknowlegements

Thanks to the following people:
Expand Down
41 changes: 22 additions & 19 deletions lib/vagrant-r10k/modulegetter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,30 @@ def call(env)
manifest_file = nil
manifests_path = nil
@env[:machine].config.vm.provisioners.each do |prov|
if prov.name == :puppet
# if module_path has been set before, check if it fits to one defined in the provisioner config
if module_path != nil
if prov.config.module_path.is_a?(Array) and ! prov.config.module_path.include?(module_path)
@env[:ui].detail "vagrant-r10k: module_path \"#{module_path}\" is not within the ones defined in puppet provisioner; not running"
@app.call(env)
return
elsif ! prov.config.module_path.is_a?(Array) and prov.config.module_path != module_path
@env[:ui].detail "vagrant-r10k: module_path \"#{module_path}\" is not the same as in puppet provisioner; not running"
@app.call(env)
return
end
# no modulepath explict set in config, build one from the provisioner config
else
module_path = prov.config.module_path.is_a?(Array) ? prov.config.module_path[0] : prov.config.module_path
@env[:ui].info "vagrant-r10k: Building the r10k module path with puppet provisioner module_path \"#{module_path}\". (if module_path is an array, first element is used)"
if prov.respond_to?(:type)
next if prov.type != :puppet
else
next if prov.name != :puppet
end
# if module_path has been set before, check if it fits to one defined in the provisioner config
if module_path != nil
if prov.config.module_path.is_a?(Array) and ! prov.config.module_path.include?(module_path)
@env[:ui].detail "vagrant-r10k: module_path \"#{module_path}\" is not within the ones defined in puppet provisioner; not running"
@app.call(env)
return
elsif ! prov.config.module_path.is_a?(Array) and prov.config.module_path != module_path
@env[:ui].detail "vagrant-r10k: module_path \"#{module_path}\" is not the same as in puppet provisioner; not running"
@app.call(env)
return
end

manifest_file = File.join(env_dir, prov.config.manifest_file)
manifests_path = File.join(env_dir, prov.config.manifests_path[1])
# no modulepath explict set in config, build one from the provisioner config
else
module_path = prov.config.module_path.is_a?(Array) ? prov.config.module_path[0] : prov.config.module_path
@env[:ui].info "vagrant-r10k: Building the r10k module path with puppet provisioner module_path \"#{module_path}\". (if module_path is an array, first element is used)"
end

manifest_file = File.join(env_dir, prov.config.manifest_file)
manifests_path = File.join(env_dir, prov.config.manifests_path[1])
end

# now join the module_path with the env_dir to have an absolute path
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-r10k/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module VagrantPlugins
module R10k
VERSION = "0.1.1"
VERSION = "0.2.0"
end
end

0 comments on commit 66f3ba6

Please sign in to comment.