diff --git a/plugins/kernel_v2/config/vm_provisioner.rb b/plugins/kernel_v2/config/vm_provisioner.rb index 61f16ba4b..a8e106f7a 100644 --- a/plugins/kernel_v2/config/vm_provisioner.rb +++ b/plugins/kernel_v2/config/vm_provisioner.rb @@ -115,6 +115,10 @@ module VagrantPlugins provisioner_names = provisioners.map { |i| i.name if i.name != name }.reject(&:nil?) + if @before && @after + errors << I18n.t("vagrant.provisioners.base.both_before_after_set") + end + if @before if !VALID_BEFORE_AFTER_TYPES.include?(@before) if @before.is_a?(Symbol) && !VALID_BEFORE_AFTER_TYPES.include?(@before) diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 5629125d3..49d99187d 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -2487,6 +2487,8 @@ en: provisioners: base: + both_before_after_set: |- + Dependency provisioners cannot currently set both `before` and `after` options. dependency_provisioner_dependency: |- Dependency provisioner "%{name}" relies on another dependency provisioner "%{dep_name}". This is currently not supported. invalid_alias_value: |-