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


Chronological Thread 
  • From: Xabier de Zuazo < >
  • To:
  • Subject: [chef] Re: How to set an attribute inside a cookbook?
  • Date: Mon, 16 Feb 2015 00:55:11 +0100

On Mon, Feb 16, 2015 at 08:04:07AM +1100, Anthony Kong wrote:
> 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']


You should use node#default:

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

If that fails, make sure the mysql cookbook is not being included before
somewhere else.

-- 
Xabier de Zuazo

Attachment: signature.asc
Description: Digital signature




Archive powered by MHonArc 2.6.16.

§