Calling attribute in kitchen.yml

#1

Iam trying to test how to call attribute which is in attribute/default.rb file defined like this
default[cm][db_name] =%w{}
Now if i want to call this attribute in the kitchen.yml file
How do i call this attribute
Iam doing this in kitchen.yml to call attribute, Iam not getting any error in kitchen converge,But my databases are not created .Can you guide me if iam calling right way or any hints would be helpful.
driver:
name: vagrant
linked_clone: true
gui: false

provisioner:
name: chef_zero
product_name: chef
product_version: 13.6.4
multiple_converge: 2
enforce_idempotency: true

verifier:
name: inspec

platforms:

  • name: centos-7
    suites:
  • name: default
    run_list:
    • recipe[c_mysql::default]
      attributes:
      cms_mysql:
      db_name:
    • casemysql
    • casemysql1
0 Likes

#2

Hi Sandeepiii,

We do it in the suites like this:

0 Likes

#3

Thank you , How you are defining attribute in the default.rb file.Because for me it does not work.

0 Likes

#4

Like this:

In your example, you had default[cm][db_name] =%w{}
unless cm and db_name are objects (vars, defs, etc.) they should be strings or symbols (I believe strings are preferred). The attributes are basically a hash (actually a mash) so these are the keys to your data values.

0 Likes