[chef] Role attributes are not getting propogated as expected


Chronological Thread 
  • From: < >
  • To:
  • Subject: [chef] Role attributes are not getting propogated as expected
  • Date: Sun, 7 Sep 2014 21:27:24 -0700 (PDT)

Hi,

I'm setting few default attributes as part of the role as defined in the below
json

{
  "name": "web1",
  "default_attributes": {
    "webmanager": {
      "steps": {
        "setup_ldap": true
      },
      "features": {
        "WindowsServicess": "",
        "Core": "(All)",
        "Gui": "FeatureWebSite",
      }
    }
  },
  "run_list": [
    "recipe[custom-web]"
  ]
}

When I try to access it as part of recipe as mentioned below it's not 
obtaining
the proper value from the role attributes as expected. It's just getting null
values.

feature[:WindowsServices] =
"\"#{node[:webmanager][:features][:WindowsServices]}\""
feature[:Core] = "\"#{node[:webmanager][:features][:Core]}\""
feature[:Gui] = "\"#{node[:webmanager][:features][:Gui]}\""

When I check it using chef-shell it's showing proper values for those
attributes. It's also getting displayed properly when I check it using `knife
node show <nodename> -l` or `knife node show <nodename> -a webmanager`. Only
problem is it's not getting set properly during converge phase of chef-client
execution.

Thanks



Archive powered by MHonArc 2.6.16.

§