shell provisioner: The following settings shouldn't exist: id

916 views
Skip to first unread message

Kurt Bosselman

unread,
Apr 7, 2014, 6:51:28 PM4/7/14
to vagra...@googlegroups.com
I'm trying to use this example from the Vagrant website for overriding provisioner settings:

Vagrant.configure("2") do |config|
  config.vm.provision "shell",
    inline: "echo foo", id: "foo"

  config.vm.define "web" do |web|
    web.vm.provision "shell",
      inline: "echo bar", id: "foo"
  end
end
And I receive the following error:


There are errors in the configuration of this machine. Please fix

the following errors and try again:


shell provisioner:

* The following settings shouldn't exist: id


Is there a new or different way to override a provision definition for a specific provider?


Thanks


Kurt Bosselman

unread,
Apr 7, 2014, 6:57:40 PM4/7/14
to vagra...@googlegroups.com

Vagrant 1.5.1 

Alvaro Miranda Aguilera

unread,
Apr 7, 2014, 10:25:58 PM4/7/14
to vagra...@googlegroups.com
Hello,

What do you mean by override? that is example

- run this_for_vmware.sh
- run this_for_virtualbox.sh

???



--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kurt Bosselman

unread,
Apr 8, 2014, 1:35:33 PM4/8/14
to vagra...@googlegroups.com

I'm trying to get the provisioner override example on this webpage working


I basically cut and pasted the example into a stripped down Vagrant file:

Vagrant.configure("2") do |config|
  config.vm.box = "precise64"

  config.vm.provision "shell",
    inline: "echo foo", id: "foo"

  config.vm.define "web" do |web|
    web.vm.provision "shell",
      inline: "echo bar", id: "foo"
  end
end

And this generates the syntax error on vagrant 1.5.1.

Kurt

ara...@getafix.org

unread,
Apr 10, 2014, 2:20:14 AM4/10/14
to vagra...@googlegroups.com
On Tuesday, April 8, 2014 10:35:33 AM UTC-7, Kurt Bosselman wrote:
> I'm trying to get the provisioner override example on this webpage working
> http://docs.vagrantup.com/v2/provisioning/basic_usage.html
> And this generates the syntax error on vagrant 1.5.1.

I get the same errors when I try to use :id in 1.5.2 as well.  I have tried it with both a basic shell provisioner and the puppet provisioner.  They fail with the same message "* The following settings shouldn't exist: id"

Aravind.

ara...@getafix.org

unread,
Apr 13, 2014, 6:37:00 AM4/13/14
to vagra...@googlegroups.com
On Monday, April 7, 2014 3:51:28 PM UTC-7, Kurt Bosselman wrote:
> shell provisioner:
> * The following settings shouldn't exist: id
> Is there a new or different way to override a provision definition for a specific provider?

This is now fixed in the latest upstream code - https://github.com/mitchellh/vagrant/commit/541ebd8935421caf4ea3634171b85a925b1a0381

Aravind.

Kurt Bosselman

unread,
Apr 18, 2014, 3:58:52 PM4/18/14
to vagra...@googlegroups.com
Aravind,

I installed 1.5.3 and the id parameter is now working with the shell provisioner. 

However, I tried to use the preserve_order flag and received a similar message:

shell provisioner:

* The following settings shouldn't exist: preserve_order


Not entirely sure I'm using it correctly as I couldn't find an example:


    config.vm.provider "virtualbox" do |vb, override|

        override.vm.provision "shell",

            inline: "echo virtualbox chef-install override", id: "chef-install", preserve_order: true

    end


But the above appears it would be correct.

Thoughts?

Aravind Gottipati

unread,
Apr 19, 2014, 5:14:12 AM4/19/14
to vagra...@googlegroups.com
On Fri, Apr 18, 2014 at 12:58 PM, Kurt Bosselman <ku...@getlive.ly> wrote:
> However, I tried to use the preserve_order flag and received a similar
> message:
>
> shell provisioner:
>
> * The following settings shouldn't exist: preserve_order
>

I suspect it's the same problem as the earlier one with :id. Try this patch.

diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb
index 79e667f..5c86afb 100644
--- a/plugins/kernel_v2/config/vm.rb
+++ b/plugins/kernel_v2/config/vm.rb
@@ -265,6 +265,7 @@ module VagrantPlugins
end

prov.preserve_order = !!options[:preserve_order]
+ options.delete(:preserve_order)
prov.add_config(options, &block)
nil
end


> Not entirely sure I'm using it correctly as I couldn't find an example:
> inline: "echo virtualbox chef-install override", id:
> "chef-install", preserve_order: true

Once you apply that patch, this should work. Try it and let me know.

Aravind.

Kurt Bosselman

unread,
Apr 21, 2014, 4:20:38 PM4/21/14
to vagra...@googlegroups.com
I patched it into commit bc9f877 and that fixed it. Shell provisioner overrides are now working as I would expect them.

Any eta on when this might get patched into a release?

Thanks
Kurt



Aravind.

--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/jL0OP5M4kCU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Aravind Gottipati

unread,
Apr 21, 2014, 4:45:58 PM4/21/14
to vagra...@googlegroups.com
On Mon, Apr 21, 2014 at 1:20 PM, Kurt Bosselman <ku...@getlive.ly> wrote:
> I patched it into commit bc9f877 and that fixed it. Shell provisioner
> overrides are now working as I would expect them.
>
> Any eta on when this might get patched into a release?
>

I am not the upstream author (or a contributor), I just happened to
have the same issue as you (for the :id stuff) and was digging into
code to figure out why. You should submit an issue here
https://github.com/mitchellh/vagrant/issues/new (with the working
patch, since you have confirmed that it works). It's a simple fix, so
it should make it's way into a release quickly.

Aravind.
Reply all
Reply to author
Forward
0 new messages