Closed unakatsuo closed 10 years ago
I can see why you want this feature however I'm not sure this is the best solution going forward. Reason is that it kind of works against keeping recipies as simple and easy to read as possible.
Would it be better to extend the DSL somehow? Exposing more of the attribs/features you need?
Thanks for suggesting this!
Yes, we need a way to make this kind of control possible. (see #77 and #67) But I would like to avoid adding a DSL method for each and every fpm attribute that exists or will exist in the future.
I would like to propose something between adding DSL methods for each attribute and exposing the complete fpm object.
What do you guys think about having a fpm_attributes
DSL method?
class Recipe < FPM::Cookery::Recipe
platform :redhat do
fpm_attributes :rpm_user => 'httpd'
end
platform :debian do
fpm_attributes :deb_user => 'apache'
end
end
We can then document existing fpm attributes including a big CAVEAT that those might change in fpm. (yes, I actually started to create some documentation ;))
This gives users some more control over that kind of settings without having to add everything to the DSL.
@bernd The syntax looks great. +1.
ok. i'll change the DSL to set the fpm attributes hash specifically.
I merged #80.
This feature allows recipe to change fpm object's attribute directly.
The classes under lib/fpm/cookery/package/* set several fixed fpm attributes. But some attributes are missing accessor method to change the value from the recipe. The fpm_hook exposes the internal object to the recipe and let user to modify it.
Example: