Skip to content

Instantly share code, notes, and snippets.

@rj-reilly
Last active August 29, 2015 14:20
Show Gist options
  • Save rj-reilly/54dfb4eac62fe1e7bd37 to your computer and use it in GitHub Desktop.
Save rj-reilly/54dfb4eac62fe1e7bd37 to your computer and use it in GitHub Desktop.
Here is my sample recipe
```
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
if node['tomcat']['base_version'].to_i == 7
if platform_family?('rhel') and node[:platform_version].to_i < 7
include_recipe 'yum-epel'
end
end
if platform_family?('windows') and node[:platform_version].to_i > 7
include_recipe 'chocolatey'
end
case node["platform_family"]
when 'windows'
chocolatey "tomcat" do
action :install
end
else
node['tomcat']['packages'].each do |pkg|
package pkg do
action :install
end
end
end
```
but I keep getting the following error
================================================================================
Error executing action `install` on resource 'chocolatey[tomcat]'
================================================================================
TypeError
---------
no implicit conversion of nil into String
Resource Declaration:
---------------------
# In C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/tomcat/recipes/default.rb
39: chocolatey "tomcat" do
40: action :install
41:
42: end
43: else
Compiled Resource:
------------------
# Declared in C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/tomcat/recipes/default.rb:39:in `from_file'
chocolatey("tomcat") do
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :chocolatey
cookbook_name "tomcat"
recipe_name "default"
package "tomcat"
end
@rj-reilly
Copy link
Author

thought it was me forcing type conversion but that did not work ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment