Error in windows cookbook in windows platform


#1

hi,

i developed cookbook with chef windows resources like windows_batch,
windows_zip and etc. With the help of windows cookbook my cookbook was
executed.
some code in my cookbook like

windows_batch “get latest from TFS” do
cwd node[‘tfsscript_path’]
code <<-EOH
tfsSchedule.exe
EOH
end
windows_zipfile “extract current deployment” do
source node[‘dest_currentDeploymentzip’]
action :unzip
path node[‘extract_currentDeploymentcode’]
not_if {::File.exists?(node[‘extract_currentDeploymentcode’])}
end

previously it was working fine but suddenly its shows error like below…

NoMethodError

No resource or method named windows_zipfile' forChef::Recipe “bitrefresh”’

No resource or method named windows_batch' forChef::Recipe “bitrefresh”’

iam using hosted chef env and dependency cookbooks like windows, powershell and
chef_handler for my own cookbook, Idont know how to resolve this??

Please share details hoe to resolve this…? Thanks in advance!!!

Regards,
Ganesan.A


#2

On Thursday, May 8, 2014 at 11:02 PM, ganesan15785@gmail.com wrote:

hi,

i developed cookbook with chef windows resources like windows_batch,
windows_zip and etc. With the help of windows cookbook my cookbook was
executed.
some code in my cookbook like

windows_batch “get latest from TFS” do
cwd node[‘tfsscript_path’]
code <<-EOH
tfsSchedule.exe
EOH
end
windows_zipfile “extract current deployment” do
source node[‘dest_currentDeploymentzip’]
action :unzip
path node[‘extract_currentDeploymentcode’]
not_if {::File.exists?(node[‘extract_currentDeploymentcode’])}
end

previously it was working fine but suddenly its shows error like below…

NoMethodError

No resource or method named windows_zipfile' forChef::Recipe “bitrefresh”’

No resource or method named windows_batch' forChef::Recipe “bitrefresh”’

iam using hosted chef env and dependency cookbooks like windows, powershell and
chef_handler for my own cookbook, Idont know how to resolve this??

Please share details hoe to resolve this…? Thanks in advance!!!

Regards,
Ganesan.A

I would guess that your cookbook isn’t specifying a dependency on the windows cookbook. You’ll want to add a depends statement. http://docs.opscode.com/essentials_cookbook_metadata.html


Daniel DeLeo