Smart Variables - are they still useful?

Hello,

Smart variables were created back in the day that parameterized Puppet
classes didn't quite work yet, and were used as a workaround to get values
into the classes until smart class parameters got to the point they are
today.
Afterwards, they remained mostly for backwards-compatibility, while the
recommended best practice for the past several years has been to use smart
class parameters and parameterized classes.
The need to support both smart variables and smart class parameters which
are fairly similar but have some differences has caused some complexity in
the code base.

So, what I'm wondering is:
Do people actually still use smart variables at all?
If so, what do you use them for?
Would that same use-case be possible using smart class parameters, or
possibly using global parameters? If not, what is missing for that to work?

I'd be happy for any feedback so we know how to best direct our efforts in
this area, even just a "No use for them" - if that's all we get, we may
consider deprecating them.

··· -- Have a nice day, Tomer Brisker Red Hat Engineering

> <snip>
> So, what I'm wondering is:
> Do people actually still use smart variables at all?
>

Only in limited use cases

> If so, what do you use them for?
>

Global parameters that we want to define on a per environment basis

> Would that same use-case be possible using smart class parameters, or
> possibly using global parameters? If not, what is missing for that to work?
>

If global parameters could have the ability to be overridden that would
solve our use case, or the ability to have 'environment parameters'

··· On Mon, May 22, 2017 at 5:53 AM, Tomer Brisker wrote:

>
>> <snip>
>> So, what I'm wondering is:
>> Do people actually still use smart variables at all?
>>
>
> Only in limited use cases
>
>
>> If so, what do you use them for?
>>
>
> Global parameters that we want to define on a per environment basis
>

I guess you mean Puppet Environment and not Katello Life Cycle Environment ?

>
>
>> Would that same use-case be possible using smart class parameters, or
>> possibly using global parameters? If not, what is missing for that to work?
>>
>
> If global parameters could have the ability to be overridden that would
> solve our use case, or the ability to have 'environment parameters'
>

They can be overridden the priority is common_parameter => 0,
:domain_parameter => 1, :subnet_parameter => 2, :os_parameter => 3, :
group_parameter => 4, :host_parameter => 5 .

··· On Fri, May 26, 2017 at 5:06 PM, Asher Schaffer wrote: > On Mon, May 22, 2017 at 5:53 AM, Tomer Brisker > wrote:


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

>
>
>
>>
>>> <snip>
>>> So, what I'm wondering is:
>>> Do people actually still use smart variables at all?
>>>
>>
>> Only in limited use cases
>>
>>
>>> If so, what do you use them for?
>>>
>>
>> Global parameters that we want to define on a per environment basis
>>
>
> I guess you mean Puppet Environment and not Katello Life Cycle Environment
> ?
>

That is correct, puppet environment

>
>>
>>> Would that same use-case be possible using smart class parameters, or
>>> possibly using global parameters? If not, what is missing for that to work?
>>>
>>
>> If global parameters could have the ability to be overridden that would
>> solve our use case, or the ability to have 'environment parameters'
>>
>
> They can be overridden the priority is common_parameter => 0,
> :domain_parameter => 1, :subnet_parameter => 2, :os_parameter => 3, :
> group_parameter => 4, :host_parameter => 5 .
>

Right, but none of those maps to environment, without smart parameters we
would end up having to duplicate the same setting across multiple subnet
parameters which makes it much more likely to make a mistake.

··· On Wed, May 31, 2017 at 7:24 AM, Sean O'Keeffe wrote: > On Fri, May 26, 2017 at 5:06 PM, Asher Schaffer > wrote: >> On Mon, May 22, 2017 at 5:53 AM, Tomer Brisker >> wrote: