Closed jaconstantine closed 9 years ago
First - what is the error you are getting from Berkshelf? If it's what I suspect, then fixing it is a matter of just moving to the https endpoint (the github alias isn't firewall friendly).
As for the main question - yes this is supported. If you intend to install from a repo then you use custom_repository
for node['riak']['install_method']
. This will install riak assuming the repo itself is already configured (a checksum isn't required as signing is already included).
When using custom_package and local URL it assumes that a build matching the Basho naming syntax exists at the URL prefix you provide. See the .kitchen.yml for examples of the local URL format and how it is used with the custom_package install method.
Here's the error from berks
:
$ berks install
Resolving cookbook dependencies...
Fetching 'hw-api-riak-node' from source at .
Fetching cookbook index from https://supermarket.getchef.com...
Unable to satisfy constraints on package pkg_add, which does not exist, due to solution constraint (riak ~> 3.1.0). Solution constraints that may result in a constraint on pkg_add: [(hw-api-riak-node = 1.0.1) -> (riak = 3.1.0) -> (pkg_add >= 0.0.0)], [(riak = 3.1.0) -> (pkg_add >= 0.0.0)]
Missing artifacts: pkg_add
Demand that cannot be met: (riak ~> 3.1.0)
Unable to find a solution for demands: hw-api-riak-node (1.0.1), riak (~> 3.1.0)
The maintainers of our local, and only allowed yum repo would prefer that it remain a filtered copy of the official rhel repo. So what we've been doing is placing the .rpm
in our nexus repo. The url to retrieve the .rpm
uses group, artifact, version, classifier and extension arguments to grab it, not a filename. What I may have to do is grab the remote and copy it to the node using your naming convention and then point the cookbook to it by using a file:///
url. Will that work?
Thanks!
Could you possibly run the berks install in verbose mode? Curious why missing gets thrown. Still probably related to the ssh vs https endpoint issues we've seen with firewalls but want to be sure.
If you aren't using a repo (in the strict yum/apt) sense and not using a URL that ends with the Basho filename format then it's going to be a bit of an issue currently. Options include adding a fully customizable URL or possibly adding a nexus artifact resource if I wanted to get carried away.
I believe the file:// url will work (the resource supports it) but I can't say I've tested it.
Context - I re-factored the cookbook recently and in doing so removed some edge case options that didn't seem like they were being leveraged. You've already proven the need for this support so it's clear I need to look at re-adding support.
The following is working just fine for me now.
In attributes/default.rb:
# Find riak rpm in nexus
default['riak-rpm'].tap do |rpm|
rpm['group_id'] = "com.basho.riak"
rpm['artifact_id'] = "riak"
rpm['classifier'] = "el6.x86_64"
rpm['version'] = "#{node['riak']['package']['version']['major']}.#{node['riak']['package']['version']['minor']}.#{node['riak']['package']['version']['incremental']}-#{node['riak']['package']['version']['build']}"
rpm['url'] = "http://nexus01:8081/nexus/service/local/artifact/maven/redirect?r=public&g="+node['riak-rpm']['group_id']+"&a="+node['riak-rpm']['artifact_id']+"&v="+node['riak-rpm']['version']+"&c="+node['riak-rpm']['classifier']+"&e=rpm"
# filename pattern example: riak-2.0.5-1.el6.x86_64.rpm
rpm['filename'] = "riak-" + node['riak-rpm']['version'] + "." + node['riak-rpm']['classifier'] + ".rpm"
end
# compute the urls and set the checksums - chef uses SHA256
default['riak']['install_method'] = 'custom_package'
# node['riak']['package']['local']['checksum'][node['platform']][plat_ver_int.to_s]
default['riak']['package']['local']['checksum']['centos']['6'] = '25434359e61eb284a595160fec552854b0971ffee3a569bdf9957c5cf04643b6'
default['riak']['package']['local']['url'] = "file:///tmp/riak"
In recipes/default.rb:
# Grab the riak rpm from nexus and put it in /tmp/riak. Then use the custom-package
# install method which makes an assumption about the filename:
# e.g. riak-2.0.5-1.el6.x86_64.rpm
directory "/tmp/riak" do
action :create
end
remote_file File.join("/tmp/riak", node['riak-rpm']['filename']) do
source node['riak-rpm']['url']
end
# Installs riak on this node. Also installs java using the 'java' cookbook when
# needed (for Solr). The java cookbook can not install from nexus!
include_recipe 'riak'
I'm trying to install 2.0.5-1 on RHEL 6.5 behind a firewall
my cookbook Berkshelf contains:
cookbook 'riak', "~> 3.1.0"
had to add to avoid berks error:
cookbook 'pkg_add', github: 'wanelo-chef/pkg_add'
I'm setting:
Is this even supported with this cookbook?
Getting a nil reference in: