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