[chef] RE: Re: VMWareTools-installation


Chronological Thread 
  • From: WEINHAPL Andreas < >
  • To: " " < >
  • Subject: [chef] RE: Re: VMWareTools-installation
  • Date: Mon, 23 May 2011 12:12:12 +0200
  • Accept-language: en-US, fr-FR
  • Acceptlanguage: en-US, fr-FR

-----Original Message-----
From: Joshua Timberman [mailto:
Sent: Samstag, 21. Mai 2011 01:06
To:
Subject: [chef] Re: VMWareTools-installation

 

Hello!

 

On Wednesday, May 18, 2011 at 6:45 AM, WEINHAPL Andreas wrote:

> Today I ve created a new role named “VMWare_Install” Its based on Ubuntu / Debian! So the first thing I do is to copy the *.tar.gz into my node working directory (with an cookbook_file statement) after that I will will extract it with an execute command. If this is finished I’ll begin to compare the installation version with the local vesion of the VMWareTools.

Did you create the file in the cookbook's "files/default" directory? => YES

 

http://wiki.opscode.com/display/chef/File+Distribution

 

Also, I suggest a couple changes to your resources, noted below:

> cookbook_file "/tmp/VMWareTools.tar.gz" do

>  puts "Copy File to its place\n"

>  source "VMWareTools.tar.gz"

>  owner "root"

>  group "root"

>  mode 0777

> end

I would use the "checksum" parameter in this resource to ensure that the file is not copied every time. You will need a SHA256 checksum, and can generate that. On linux, use sha256sum:

 

sha256sum VMwareTools.tar.gz

 

Mac OS X does not have a sha256sum binary, but you can generate the checksum with a Chef library :)

 

ruby -rchef/checksum_cache -e 'puts Chef::ChecksumCache.checksum_for_file("VMWareTools.tar.gz")'

 

-> How should I use this line? In the recipe at the sequende cookbook_file?

 

Supply the full path to the .tar.gz if its not in the cwd.

 

> execute "Unpacking the Installer File" do

>  puts "Extracting installation File\n"

>  command "/bin/tar zxf /tmp/VMWareTools.tar.gz -C /tmp/"

>  action :run

> end

 

I would have this be action :nothing with a "subscribe" meta-parameter on the cookbook_file resource.

 

subscribes :run, "cookbook_file[/tmp/VMwareTools.tar.gz]", :immediately

 

è    Many thanks, now it works J I can’t know why but I think that the copy state will take to long?

 

See: http://wiki.opscode.com/display/chef/Resources#Resources-Notifications

 

In both resources, you do not need the "puts" line, as Chef will display a message about the resource it is configuring at run time.

 

--

Opscode, Inc.

Joshua Timberman, Director of Training and Services

IRC, Skype, Twitter, Github: jtimberman

 

 




Archive powered by MHonArc 2.6.16.

§