- From: Adam Jacob <
>
- To: "
" <
>
- Subject: [chef] Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM
- Date: Fri, 7 Dec 2012 19:29:53 +0000
- Accept-language: en-US
Use the REST api like a boss, man. That's what it is there for.
Adam
On 12/7/12 10:17 AM, "Cassiano Leal"
<
>
wrote:
>
It would be nice to know the reasoning behind not using the REST client.
>
>
>
When I have the time, I'll experiment with both before deciding the way
>
forward.
>
>
>
Thanks!
>
--
>
Cassiano Leal
>
>
>
>
On Friday, December 7, 2012 at 15:58, steve . wrote:
>
>
I seem to recall someone from Opscode steering people away from making
>
direct calls using Chef's internal REST client for some reason. I'd do
>
it through the Knife object, something like (untested code alert):
>
>
>
Chef::Knife::ClientDelete.run(env[:vm].config.vm.host_name)
>
>
>
>
>
>
On Thu, Dec 6, 2012 at 7:48 AM, Cassiano Leal
>
<
>
>
wrote:
>
>
Nice one.
>
>
>
Just one correction to my original post, the link to my gist is
>
https://gist.github.com/4223941 <https://gist.github.com/4223941> and not
>
the one I sent before (that was a reference).
>
>
>
I like your REST approach, though, and will certainly have a look at that.
>
>
>
Thanks,
>
--
>
Cassiano Leal
>
>
>
>
On Thursday, December 6, 2012 at 12:04, Jesse Nelson wrote:
>
>
meant to say "no subshell" not "syscall"
>
>
>
On Thu, Dec 6, 2012 at 11:04 PM, Jesse Nelson
>
<
>
>
wrote:
>
>
You can check out the code in my chef-sandbox that does this using the
>
vagrant provisioner class and chef client code directly (no syscall:
>
>
>
https://github.com/spheromak/chef-sandbox/blob/develop/Vagrantfile#L52-L96
>
>
<https://github.com/spheromak/chef-sandbox/blob/develop/Vagrantfile#L52-L9
>
6>
>
>
>
>
Change:
>
>
>
::Chef::Config.from_file(File.join( File.dirname(__FILE__), 'chef',
>
'knife.rb'))
>
>
>
To point to your knife.rb location.
>
Pop the rest in your vagrant file, and you should be good.
>
>
>
On Thu, Dec 6, 2012 at 9:03 PM, Cassiano Leal
>
<
>
>
wrote:
>
>
I was trying to find a solution for that on the web, and the two
>
references that made more sense were:
>
>
>
>
http://frank.be/articles/2011/12/16/vagrant-and-chef-auto-deregister-on-vm
>
-destroy/
>
https://gist.github.com/1010660
>
>
>
Neither worked out of the box, so I hacked my own solution, adapting a
>
bit from each, and came to this:
>
>
>
https://gist.github.com/1010660
>
>
>
Feel free to use it if you find it useful. Comments and suggestions are
>
welcome.
>
>
>
Cheers!
>
--
>
Cassiano Leal
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
- [chef] Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/06/2012
- [chef] Re: Delete node and client when destroying Vagrant VM, Jesse Nelson, 12/06/2012
- [chef] Re: Delete node and client when destroying Vagrant VM, Jesse Nelson, 12/06/2012
- [chef] Re: Re: Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/06/2012
- [chef] Re: Re: Re: Delete node and client when destroying Vagrant VM, steve ., 12/07/2012
- [chef] Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/07/2012
- [chef] Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Adam Jacob, 12/07/2012
- [chef] Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Daniel DeLeo, 12/07/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/07/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Jamie Winsor, 12/07/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/08/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Jamie Winsor, 12/08/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/08/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/09/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Juanje Ojeda Croissier, 12/09/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Cassiano Leal, 12/10/2012
- [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Delete node and client when destroying Vagrant VM, Erik Hollensbe, 12/10/2012
Archive powered by MHonArc 2.6.16.