[chef] Re: create databag by chef-solo


Chronological Thread 
  • From: gregory grey < >
  • To: Lamont Granquist < >
  • Cc:
  • Subject: [chef] Re: create databag by chef-solo
  • Date: Fri, 6 Mar 2015 10:37:03 +0100

Hi, when I run kitchen with chef-zero as a provisioner, I get error:

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

        >>>setupcluster "target" do
              action :prepare
        end


...which was not there when I was testing it via chef-solo.

Is there some alterations to be made?

setupcluster is LWPR, defined in resources/setupcluster.rb and providers/setupcluster.rb

Thanks,

Greg

2015-03-05 20:19 GMT+01:00 Lamont Granquist < " target="_blank"> >:

You should use chef-client -z instead of chef-solo.  The chef core data bag libraries assumes it is talking to a server, and does not know how to create data bags on the filesystem under chef-solo. Chef-client -z fires up a minimal chef server API in the background so that you get a chef-solo-like local interface but all the APIs in core chef which expect to talk to a server can talk to a server.

On 3/5/15 7:08 AM, gregory grey wrote:
Ohai, chefs!

I'm running the following:

cluster= Chef::DataBag.new
cluster.name <http://legs.name>("#{current}-cluster")
cluster.create

to create the databag as a preparatory step.

When testes via kitchen, I get an error

       I cannot read /tmp/kitchen/client.pem, which you told me to use to sign requests!

Thanks,

Greg





Archive powered by MHonArc 2.6.16.

§