Home:ALL Converter>Chef-client No resource or method named `source'

Chef-client No resource or method named `source'

Ask Time:2018-06-08T22:03:59         Author:jaseUK

Json Formatter

I'm getting the below error when trying to provision a new server. All was working fine previously so not to sure why I'm getting this. Is this staying I can no longer use source when using templates?

NoMethodError
-------------
No resource or method named `source' for `Chef::Recipe "default"'

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/switch/recipes/default.rb:15:in `from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/switch/recipes/default.rb:


 13:  if node.chef_environment == 'uk'
 14:    template "/etc/odbc.ini"
 15>>   source "odbc.ini.erb"
 16:    mode 0644
 17:  end
 18:
 19:  case node['switch']['install_method']
 20:  when 'package'
 21:    include_recipe 'switch::package'
 22:  when 'source'
 23:    include_recipe 'switch::source'
 24:  end

System Info:
------------
chef_version=12.21.31
platform=debian
platform_version=8.10
ruby=ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
program_name=chef-client worker: ppid=2913;start=14:31:46;
executable=/opt/chef/bin/chef-client`

Author:jaseUK,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50762419/chef-client-no-resource-or-method-named-source
yy