Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derived Attributes Non-Functional in Chef 12+ #117

Closed
joshburt opened this issue Feb 3, 2015 · 5 comments · Fixed by #118
Closed

Derived Attributes Non-Functional in Chef 12+ #117

joshburt opened this issue Feb 3, 2015 · 5 comments · Fixed by #118

Comments

@joshburt
Copy link

joshburt commented Feb 3, 2015

Validated that the 11.x Chef clients work fine, and the issue is present only in 12+ environments.

Within the cookbook attribute file: iis/attributes/default.rb

This is currently defined:
default['iis']['home'] = "#{ENV['WINDIR']}\\System32\\inetsrv"
default['iis']['conf_dir'] = "#{iis['home']}\\config"
default['iis']['pubroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub"
default['iis']['docroot'] = "#{iis['pubroot']}\\wwwroot"
default['iis']['log_dir'] = "#{iis['pubroot']}\\logs\\LogFiles"
default['iis']['cache_dir'] = "#{iis['pubroot']}\\temp"

As of chef 12 only the first derived attribute is properly calculated. Printing out the values within a run is enough to see the issue:
DEBUG: default['iis']['home'] = C:\Windows\System32\inetsrv
DEBUG: default['iis']['conf_dir'] = C:\Windows\System32\inetsrv\config
DEBUG: default['iis']['pubroot'] = C:\inetpub
DEBUG: default['iis']['docroot'] = \wwwroot
DEBUG: default['iis']['log_dir'] = \logs\LogFiles
DEBUG: default['iis']['cache_dir'] = \temp

You can see that only the first attribute is properly calculated be reversing the order of declaration and running again:
default['iis']['pubroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub"
default['iis']['docroot'] = "#{iis['pubroot']}\\wwwroot"
default['iis']['log_dir'] = "#{iis['pubroot']}\\logs\\LogFiles"
default['iis']['cache_dir'] = "#{iis['pubroot']}\\temp"
default['iis']['home'] = "#{ENV['WINDIR']}\\System32\\inetsrv"
default['iis']['conf_dir'] = "#{iis['home']}\\config"

In this scenario only iis[home] will be empty.

If you fully declare the attributes as below it works in other recipes:
default['iis']['home'] = "#{ENV['WINDIR']}\\System32\\inetsrv"
default['iis']['conf_dir'] = "#{ENV['WINDIR']}\\System32\\inetsrv\\config"
default['iis']['pubroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub"
default['iis']['docroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub\\wwwroot"
default['iis']['log_dir'] = "#{ENV['SYSTEMDRIVE']}\\inetpub\\logs\\LogFiles"
default['iis']['cache_dir'] = "#{ENV['SYSTEMDRIVE']}\\inetpub\\temp

EDIT:
I've also submitted: chef-boneyard/chef-client#258

@EasyAsABC123
Copy link
Contributor

@joshburt thanks for bringing this to my attention, i've added a pull request...

@smurawski I have to believe this is a real issue as without test-kitchen I do not test chef 12+. I'll be at chef con attending the test-kitchen training so hopefully we can get this repo better tested.

@joshburt
Copy link
Author

joshburt commented Feb 3, 2015

Thanks for the quick response! We're re-factoring code to support a Chef 12 upgrade, and this was definitely something we needed help with.

@EasyAsABC123
Copy link
Contributor

@joshburt never a problem, as we are working to make iis@3 a release bugs need to be resolved.

@ksubrama
Copy link

ksubrama commented Feb 5, 2015

I don't actually see any of those attributes, save for iis home being referenced anywhere else in this cookbook. Do we need these attributes at all? @joshburt - how are you using these attributes? Do you need them in this cookbook or can you just generate them yourself within your recipes?

@EasyAsABC123
Copy link
Contributor

@ksubrama you are correct only ['iis']['home'] is in use, however a lot of the other attributes should likely be used as the default logging path and cache path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants