- From: AJ Christensen <
>
- To: "
" <
>
- Subject: [chef] Re: apt repository cookbook
- Date: Fri, 20 Feb 2015 08:42:42 +1300
No need to use a cookbook. Try aptly, it's stand-alone
http://www.aptly.info/ -- packagecloud.io is similar, but a hosted
SaaS.
You might be able to use the LWRPs from that Heavy Water repository
cookbook without using the recipes.
It looks like the resource declaration at line 34-37 is the wrong type
of resource. It looks as though you want a
Chef::Resource::RepositoryPackage (repository_package), which has the
repository parameter/argument:
https://github.com/hw-cookbooks/repository/blob/master/resources/package.rb
The repository resource is special 'default' LWRP.
I wouldn't really recommend using any community cookbooks (not even
mine), especially if you don't know what the code is doing. You are
effectively backdoor/root shelling all of your machines with
ignorance.
cheers,
--aj
On Fri, Feb 20, 2015 at 8:32 AM, Douglas Garstang
<
>
wrote:
>
I'm trying to set up an apt repository with chef. Trying to use a community
>
cookbook, I found this one: https://github.com/hw-cookbooks/repository
>
>
It's readme says to drop new deb files into the /srv/repository_incoming
>
directory and then run the chef-client. Doing that gets me this error:
>
>
==> default: NoMethodError
>
==> default: -------------
>
==> default: undefined method `repository' for Chef::Resource::Repository
>
==> default:
>
==> default:
>
==> default: Cookbook Trace:
>
==> default: ---------------
>
==> default:
>
/tmp/vagrant-chef/8c7b6c4971128a90594d5194827546c6/cookbooks/repository/recipes/incoming.rb:36:in
>
`block (3 levels) in from_file'
>
==> default:
>
/tmp/vagrant-chef/8c7b6c4971128a90594d5194827546c6/cookbooks/repository/recipes/incoming.rb:33:in
>
`each'
>
==> default:
>
/tmp/vagrant-chef/8c7b6c4971128a90594d5194827546c6/cookbooks/repository/recipes/incoming.rb:33:in
>
`block (2 levels) in from_file'
>
==> default:
>
==> default:
>
==> default:
>
==> default: Resource Declaration:
>
==> default: ---------------------
>
==> default: # In
>
/tmp/vagrant-chef/8c7b6c4971128a90594d5194827546c6/cookbooks/repository/recipes/incoming.rb
>
==> default:
>
==> default: 30: ruby_block 'Repository - Process incoming' do
>
==> default: 31: action :nothing
>
==> default: 32: block do
>
==> default: 33:
>
Dir.glob(File.join(node[:repository][:incoming][:directory], '*.deb')).each
>
do |deb_file|
>
==> default: 34: r = Chef::Resource::Repository.new(deb_file,
>
run_context)
>
==> default: 35: r.action :nothing
>
==> default: 36: r.repository node[:repository][:incoming][:name]
>
==> default: 37: r.run_action(:add)
>
==> default: 38: end
>
==> default: 39: end
>
==> default: 40: only_if do
>
==> default: 41:
>
File.directory?(node[:repository][:incoming][:directory])
>
==> default: 42: end
>
==> default: 43: end
>
>
I've been digging around and I can't even find the
>
Chef::Resource::Repository resource, so I have no idea what's going on. Any
>
idea? Or, is there a better community cookbook for managing a private apt
>
repository?
>
>
Doug
>
Archive powered by MHonArc 2.6.16.