RiotGamesCookbooks / artifact-cookbook

Provides your cookbooks with the Artifact Deploy LWRP
Other
133 stars 91 forks source link

uninitialized constant Chef::Resource::ArtifactFile on Chef client 13 #173

Open athreyavc1 opened 7 years ago

athreyavc1 commented 7 years ago

Hi, artifact-cookbook not working after I upgraded the chef client to

chef-client -v
Chef: 13.0.113
Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/artifact/providers/file.rb:48:in `load_current_resource'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/testsite/recipes/default.rb

     22: artifact_file  "/opt/#{node['home']['projectname']}.zip" do
     23:   location  "http://www.free-css.com/assets/files/free-css-templates/download/page211/lacegant.zip"
     24:   owner "root"
     25:   group "root"
     26:   action :create
     27: end
     28:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/testsite/recipes/default.rb:22:in `from_file'

    artifact_file("/opt/lacegant.zip") do
      action [:create]
      default_guard_interpreter :default
      declared_type :artifact_file
      cookbook_name "testsite"
      recipe_name "default"
      location "http://www.free-css.com/assets/files/free-css-templates/download/page211/lacegant.zip"
      owner "root"
      group "root"
      path "/opt/lacegant.zip"
    end

    System Info:
    ------------
    chef_version=13.0.113
    platform=centos
    platform_version=7.3.1611
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
    program_name=chef-client worker: ppid=59841;start=10:10:39;
    executable=/opt/chef/bin/chef-client

Chef Server is 12.x

Regards,

athreyavc1 commented 7 years ago

Changed artifact/providers/file.rb line 48 to

# @current_resource = Chef::Resource::ArtifactFile.new(@new_resource.name)
  @current_resource = Chef::Resource.resource_for_node(:artifact_file, node)
  @current_resource

Working now.

hamitron commented 5 years ago

Would be nice if this change was pushed.

hamitron commented 5 years ago

I was able to resolve this issue by using the built in remote_file resource, and I've heard the Ark Cookbook is useful as well