[chef] Re: How to set an attribute inside a cookbook?


Chronological Thread 
  • From: Lamont Granquist < >
  • To:
  • Subject: [chef] Re: How to set an attribute inside a cookbook?
  • Date: Sun, 15 Feb 2015 17:25:38 -0800


Try moving setting the attribute into an attribute file.

On 2/15/15 1:04 PM, Anthony Kong wrote:
" type="cite">
Hi,

I want to set an attribute in another cookbook otherwise it will fail during 'kitchen converge'

       Chef::Exceptions::ValidationFailed
       ----------------------------------
       Required argument password is missing!

        23:
        24:  # Set password according to attribute, if set
        25:  mysqld_password 'root' do
        26>>   password node['mysqld']['root_password']

I have tried these 

node['mysqld']['root_password'] = 'password'

and 

node.default['mysqld']['root_password'] = 'password'

before this line

include_recipe "mysqld"

But apparently it has no effect.

What is the proper way to set a variable of a included cookbook?




Archive powered by MHonArc 2.6.16.

§