From 6777493c461a51a2e1d6d48055eff389772a84b9 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 20 Aug 2019 11:31:00 -0700 Subject: [PATCH] Include before/after options in final provision hash --- lib/vagrant/action/builtin/mixin_provisioners.rb | 9 +++++++++ plugins/kernel_v2/config/vm_provisioner.rb | 2 ++ 2 files changed, 11 insertions(+) diff --git a/lib/vagrant/action/builtin/mixin_provisioners.rb b/lib/vagrant/action/builtin/mixin_provisioners.rb index 3d712c954..5c17556ad 100644 --- a/lib/vagrant/action/builtin/mixin_provisioners.rb +++ b/lib/vagrant/action/builtin/mixin_provisioners.rb @@ -29,6 +29,8 @@ module Vagrant options = { name: provisioner.name, run: provisioner.run, + before: provisioner.before, + after: provisioner.after, } # Return the result @@ -38,6 +40,13 @@ module Vagrant return @_provisioner_instances.compact end + # Sorts provisioners based on order specified with before/after options + # + # @return [Array] + def sort_provisioner_instances(pvs) + return pvs + end + # This will return a mapping of a provisioner instance to its # type. def provisioner_type_map(env) diff --git a/plugins/kernel_v2/config/vm_provisioner.rb b/plugins/kernel_v2/config/vm_provisioner.rb index 1dcdeedc1..309281d27 100644 --- a/plugins/kernel_v2/config/vm_provisioner.rb +++ b/plugins/kernel_v2/config/vm_provisioner.rb @@ -105,6 +105,8 @@ module VagrantPlugins @config.finalize! end + # Validates the before/after options + # # @param [Vagrant::Machine] machine - machine to validate against # @param [Array] provisioner_names - Names of provisioners for a given machine # @return [Array] array of strings of error messages from config option validation