From 8e3dbce1371fc6d0a85c03390d8c953ed0bccd49 Mon Sep 17 00:00:00 2001 From: Shane Gibbs Date: Sat, 15 Feb 2014 11:09:06 +1300 Subject: [PATCH] Add backwards compatibility for older versions of chef that do not support multiple role paths. --- templates/provisioners/chef_solo/solo.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/provisioners/chef_solo/solo.erb b/templates/provisioners/chef_solo/solo.erb index 95c8a30f4..969901658 100644 --- a/templates/provisioners/chef_solo/solo.erb +++ b/templates/provisioners/chef_solo/solo.erb @@ -1,3 +1,5 @@ +require 'chef/version_constraint' + <% if node_name %> node_name "<%= node_name %>" <% end %> @@ -5,7 +7,11 @@ file_cache_path "<%= file_cache_path %>" file_backup_path "<%= file_backup_path %>" cookbook_path <%= cookbooks_path.inspect %> <% 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 %> log_level <%= log_level.inspect %> verbose_logging <%= verbose_logging.inspect %>