-
Notifications
You must be signed in to change notification settings - Fork 25
Update resources to current quality standards #20
Comments
In the interest of collaboration and consolidation: There is a fork of this cookbook, The goal would be to make use of either cookbook interchangeable and backwards compatible. |
Further, the reason to keep the |
Oh hello. I don't think that I did much more than a find and replace to substitute I used |
The It wouldn't be terribly difficult to maintain backwards compatibility with mac_os_x_userdefaults "enable time machine on unsupported volumes" do
domain "com.apple.systempreferences"
key "TMShowUnsupportedNetworkVolumes"
value "1"
end
# equivalent to this from your cookbook:
osx_userdefaults "enable time machine on unsupported volumes" do
domain "com.apple.systempreferences"
key "TMShowUnsupportedNetworkVolumes"
value "1"
end
# equivalent to this (which would be the actual resource):
user_defaults "enable time machine on unsupported volumes" do
domain "com.apple.systempreferences"
key "TMShowUnsupportedNetworkVolumes"
value "1"
end |
The resources in this cookbook were written many moons ago. It was a primitive time, when things like "testing" weren't done.
Laundry list of improvements this cookbook needs:
Test Kitchen
While we can't distribute OS X vagrant boxes for using Test Kitchen, internally at CHEF we have some, and we should use those to enable testing with Test Kitchen.
Rename the Resources
This cookbook includes two resources:
These are both awkward to type. They are also relatively simple LWRPs, and could be easily converted to subclass
LWRPBase
. This would give better flexibility for making alias resources. I am proposing:This gives clarity that they're for OS X. The old resource names would be aliases, and the attributes would remain.
State Attributes
Chef Reporting uses "state attributes" for reporting information about a Chef run. We should define those for the resources in this cookbook.
Why Run Mode
The LWRPs use inline resources, which gives us automatic why run mode support. This should be defined with the
why_run_supported?
method defined to returntrue
.Use inline resources
As stated, LWRPs here use inline resources, but we don't use the
use_inline_resources
method.Use default action
We set default actions using
#initialize
rather than thedefault_action
method.ChefSpec Coverage
We need full ChefSpec coverage. This is related to Test Kitchen support.
ServerSpec Coverage
We need adequate ServerSpec coverage. This is related to Test Kitchen support.
Backwards Compatibility
This cookbook must remain backwards compatible. We can achieve that through proper test coverage.
Tests must be written and verified before refactoring the resources begins.
Platform Support
The goal is to support the following OS X platform versions:
Initially, 10.9 and 10.10 will be supported (as I have VMware Fusion vagrant boxes for TK). 10.8 support can come if a) someone provides it or b) it just works without additional effort. To my knowledge, Apple hasn't dramatically changed the way the
defaults(1)
system works.The text was updated successfully, but these errors were encountered: