Role attributes are not getting propogated as expected


#1

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


#2

Not sure if this is just a typo in the email or actually in your code,
but you have two s’s in WindowsServices(s) in the role.

-Sheppy

On Sun, 2014-09-07 at 21:27 -0700, ppalanisamy@sdl.com wrote:

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


#3

Hi Sheppy,

That was a typo. Even other two attributes Core & Gui are not getting defined properly.

Thanks,

-----Original Message-----
From: Sheppy Reno [mailto:sheppy.reno@RACKSPACE.COM]
Sent: Monday, September 08, 2014 2:56 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Role attributes are not getting propogated as expected

Not sure if this is just a typo in the email or actually in your code, but you have two s’s in WindowsServices(s) in the role.

-Sheppy

On Sun, 2014-09-07 at 21:27 -0700, ppalanisamy@sdl.com wrote:

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

SDL PLC confidential, all rights reserved.
If you are not the intended recipient of this mail SDL requests and requires that you delete it without acting upon or copying any of its contents, and we further request that you advise us.
SDL PLC is a public limited company registered in England and Wales. Registered number: 02675207.
Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 7DY, UK.

This message has been scanned for malware by Websense. www.websense.com