Merge pull request #2975 from shanegibbs/chef-solo-role-path

Add support for multiple role paths in chef-solo >= 11.8.0
This commit is contained in:
Teemu Matilainen 2014-02-21 23:58:10 -02:00
commit 24f7d7b9eb
2 changed files with 8 additions and 2 deletions

View File

@ -117,7 +117,7 @@ module VagrantPlugins
def setup_solo_config def setup_solo_config
cookbooks_path = guest_paths(@cookbook_folders) cookbooks_path = guest_paths(@cookbook_folders)
roles_path = guest_paths(@role_folders).first roles_path = guest_paths(@role_folders)
data_bags_path = guest_paths(@data_bags_folders).first data_bags_path = guest_paths(@data_bags_folders).first
environments_path = guest_paths(@environments_folders).first environments_path = guest_paths(@environments_folders).first
setup_config("provisioners/chef_solo/solo", "solo.rb", { setup_config("provisioners/chef_solo/solo", "solo.rb", {

View File

@ -1,3 +1,5 @@
require 'chef/version_constraint'
<% if node_name %> <% if node_name %>
node_name "<%= node_name %>" node_name "<%= node_name %>"
<% end %> <% end %>
@ -5,7 +7,11 @@ file_cache_path "<%= file_cache_path %>"
file_backup_path "<%= file_backup_path %>" file_backup_path "<%= file_backup_path %>"
cookbook_path <%= cookbooks_path.inspect %> cookbook_path <%= cookbooks_path.inspect %>
<% if roles_path %> <% if roles_path %>
role_path <%= roles_path.inspect %> if Chef::VersionConstraint.new("< 11.8.0").include?(Chef::VERSION)
role_path <%= roles_path.first.inspect %>
else
role_path <%= roles_path.inspect %>
end
<% end %> <% end %>
log_level <%= log_level.inspect %> log_level <%= log_level.inspect %>
verbose_logging <%= verbose_logging.inspect %> verbose_logging <%= verbose_logging.inspect %>