Detecting vagrant inside a chef recipe / Dealing with changes to sudoers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Detecting vagrant inside a chef recipe / Dealing with changes to sudoers

Zahary Karadjov
Hello,

Does Vagrant add some standard node properties that can be detected inside a chef recipe? (I know I can easily add such myself in the Vagrant file).

The reason I'm asking is that Vagrant is not very friendly to chef setups that make modifications to the sudoers file.
You have to make sure that the vagrant user still has rights and /opt/vagrant_ruby/bin/ is within the secure_path.
Otherwise, you'll get the following error:

The chef binary (either `chef-solo` or `chef-client`) was not found on
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.

Are there some known good solutions for this problem?


--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Detecting vagrant inside a chef recipe / Dealing with changes to sudoers

Mike
We use this commonly:

  only_if { node.attribute?('vagrant') }

and it serves us pretty well.
-M

On Wed, Jan 30, 2013 at 11:12 AM, Zahary Karadjov <[hidden email]> wrote:

> Hello,
>
> Does Vagrant add some standard node properties that can be detected inside a
> chef recipe? (I know I can easily add such myself in the Vagrant file).
>
> The reason I'm asking is that Vagrant is not very friendly to chef setups
> that make modifications to the sudoers file.
> You have to make sure that the vagrant user still has rights and
> /opt/vagrant_ruby/bin/ is within the secure_path.
> Otherwise, you'll get the following error:
>
> The chef binary (either `chef-solo` or `chef-client`) was not found on
> the VM and is required for chef provisioning. Please verify that chef
> is installed and that the binary is available on the PATH.
>
>
> Are there some known good solutions for this problem?
>
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.