[openstack-dev] [puppet] service default value functions

Cody Herriges cody at puppetlabs.com
Wed Sep 23 16:46:58 UTC 2015


Alex Schultz wrote:
>> I've been mulling this over the last several days and I just can't
>> accept an entire ruby function which would be ran for every parameter
>> with the desired static value of "<SERVICE DEFAULT>" when the class is
>> declared and parsed.  I am not generally against using functions as a
>> parameter default just not a fan in this case because running ruby just
>> to return a static string seems inappropriate and not optimal.
>>
>> In this specific case I think the params pattern and inheritance can
>> obtain us the same goals.  I also find this a valid us of inheritance
>> cross module namespaces but...only because all our modules must depend
>> on puppet-openstacklib.
>>
>> http://paste.openstack.org/show/473655
>>
> 
> Yes after thinking it over, I agree that the function for a parameter
> is probably not the best route.  I think going the inheritance route
> is a much more established pattern and would make more sense.
> 
> Just throwing this out there, another option could be using a fact in
> puppet-openstacklib. We could create an os_service_default fact or
> something named similarly that would be a static constant that could
> be used for a parameter default and we could leverage it as part of
> the is_service_default() function.  We would still require
> puppet-openstacklib be included but we wouldn't need to do all the
> inherits in the classes.  Just a thought.
> 

That is a viable option.  I can't recall which versions of puppet
support facts.d but if all that we support do we could even make it 100%
static and just put a file on disk with the contents
"servicedefault='<SERVICE DEFAULT>'.

-- 
Cody

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150923/8d0714fe/attachment.pgp>


More information about the OpenStack-dev mailing list