priestjim / chef-rundeck

A Chef cookbook for the remote administration tool Rundeck
Other
28 stars 46 forks source link

Proposed change to how cookbook handles stub files #11

Closed zarry closed 10 years ago

zarry commented 10 years ago

I am suggesting a change to how the the cookbook handles the stub files around line 159. This section of code below handles files that have a need to be changed given an implementation. Using the wrapper cookbook model this creates an additional dependency on the chef-rewind gem.

# Stub files from the cookbook, override with chef-rewind
%w{ log4j.properties jaas-loginmodule.conf apitoken.aclpolicy admin.aclpolicy }.each do |cf|
    cookbook_file "/etc/rundeck/#{cf}" do
        source cf
        owner 'rundeck'
        group 'rundeck'
        mode 00644
        action :create
    end
end

With a rather simple change we can remove the need for that dependency. I am proposing moving that array's data into an attribute. By doing that, you can then easily override the value from your wrapper cookbook removing files you will manage in your wrapper cookbook without the need for an additional dependency on the chef-rewind gem. I actually believe this approach is more scale-able as well.

I am going to be making this change locally and playing around with it. I wanted to get an issue up here to start discussion and get some thoughts before I submitted a pull request with this change.

priestjim commented 10 years ago

Fixed by merging PR #12