diff --git a/plugins/provisioners/chef/config/chef_zero.rb b/plugins/provisioners/chef/config/chef_zero.rb index d28de3dc9..9b1daf1a5 100644 --- a/plugins/provisioners/chef/config/chef_zero.rb +++ b/plugins/provisioners/chef/config/chef_zero.rb @@ -17,6 +17,10 @@ module VagrantPlugins # @return [String] attr_accessor :environments_path + # The path where nodes are stored on disk. + # @return [String] + attr_accessor :nodes_path + # The path where roles are stored on disk. # @return [String] attr_accessor :roles_path @@ -31,6 +35,7 @@ module VagrantPlugins @cookbooks_path = UNSET_VALUE @data_bags_path = UNSET_VALUE @environments_path = UNSET_VALUE + @nodes_path = UNSET_VALUE @roles_path = UNSET_VALUE @synced_folder_type = UNSET_VALUE end @@ -47,6 +52,7 @@ module VagrantPlugins end @data_bags_path = [] if @data_bags_path == UNSET_VALUE + @nodes_path = [] if @nodes_path == UNSET_VALUE @roles_path = [] if @roles_path == UNSET_VALUE @environments_path = [] if @environments_path == UNSET_VALUE @environments_path = [@environments_path].flatten @@ -54,6 +60,7 @@ module VagrantPlugins # Make sure the path is an array. @cookbooks_path = prepare_folders_config(@cookbooks_path) @data_bags_path = prepare_folders_config(@data_bags_path) + @nodes_path = prepare_folders_config(@nodes_path) @roles_path = prepare_folders_config(@roles_path) @environments_path = prepare_folders_config(@environments_path) diff --git a/plugins/provisioners/chef/provisioner/chef_solo.rb b/plugins/provisioners/chef/provisioner/chef_solo.rb index f3b52f178..14ee5747c 100644 --- a/plugins/provisioners/chef/provisioner/chef_solo.rb +++ b/plugins/provisioners/chef/provisioner/chef_solo.rb @@ -33,12 +33,14 @@ module VagrantPlugins @role_folders = expanded_folders(@config.roles_path, "roles") @data_bags_folders = expanded_folders(@config.data_bags_path, "data_bags") @environments_folders = expanded_folders(@config.environments_path, "environments") + @node_folders = expanded_folders(@config.nodes_path, "nodes") existing = synced_folders(@machine, cached: true) share_folders(root_config, "csc", @cookbook_folders, existing) share_folders(root_config, "csr", @role_folders, existing) share_folders(root_config, "csdb", @data_bags_folders, existing) share_folders(root_config, "cse", @environments_folders, existing) + share_folders(root_config, "csn", @node_folders, existing) end def provision diff --git a/plugins/provisioners/chef/provisioner/chef_zero.rb b/plugins/provisioners/chef/provisioner/chef_zero.rb index 48078a09f..70fff6854 100644 --- a/plugins/provisioners/chef/provisioner/chef_zero.rb +++ b/plugins/provisioners/chef/provisioner/chef_zero.rb @@ -44,6 +44,7 @@ module VagrantPlugins local_mode: true, enable_reporting: false, cookbooks_path: guest_paths(@cookbook_folders), + nodes_path: guest_paths(@node_folders), roles_path: guest_paths(@role_folders), data_bags_path: guest_paths(@data_bags_folders).first, environments_path: guest_paths(@environments_folders).first, diff --git a/templates/provisioners/chef_zero/zero.erb b/templates/provisioners/chef_zero/zero.erb index 29de30d23..8c4b76407 100644 --- a/templates/provisioners/chef_zero/zero.erb +++ b/templates/provisioners/chef_zero/zero.erb @@ -31,8 +31,8 @@ environment "<%= environment %>" chef_zero.enabled true local_mode true <% end -%> -<% if node_path -%> -node_path <%= node_path.inspect %> +<% if nodes_path -%> +node_path <%= nodes_path.inspect %> <% end -%> <% if formatter %>