[Wikitech-l] wmf getting ready for puppet3, advice please

2014-01-28 Thread Ariel T. Glenn
Hi puppet wranglers,

We're trying to refactor the WMF puppet manifests to get rid of reliance
on dynamic scope, since puppet 3 doesn't permit it.  Until now we've
done what is surely pretty standard pupet 2.x practice: assign
values to a variable in the node definition and pick it up in the
class from there dynamically.  Example: we set $openstack_version
to a specific version depending on the node, and the nova and
openstack classes do different things depending on that value.

Without dynamic scoping that's no longer possible, so I'm wondering
what people are doing in the real world to address this, and
what best practices are, if any.  Hiera? Some sort of class
parameterization?  Something else?

It should go without saying that we'd like not to have to massively
rewrite all our manifests, if possible.

Thanks,

Ariel Glenn



___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] wmf getting ready for puppet3, advice please

2014-01-28 Thread Ryan Lane
On Tue, Jan 28, 2014 at 2:41 AM, Ariel T. Glenn ar...@wikimedia.org wrote:

 Hi puppet wranglers,

 We're trying to refactor the WMF puppet manifests to get rid of reliance
 on dynamic scope, since puppet 3 doesn't permit it.  Until now we've
 done what is surely pretty standard pupet 2.x practice: assign
 values to a variable in the node definition and pick it up in the
 class from there dynamically.  Example: we set $openstack_version
 to a specific version depending on the node, and the nova and
 openstack classes do different things depending on that value.

 Without dynamic scoping that's no longer possible, so I'm wondering
 what people are doing in the real world to address this, and
 what best practices are, if any.  Hiera? Some sort of class
 parameterization?  Something else?

 It should go without saying that we'd like not to have to massively
 rewrite all our manifests, if possible.


In puppet3 variables assigned in the node are still global. It's the only
place other than facts (or hiera) that you can assign them and have their
scope propagate. So, this'll continue working. I think the future path is
surely to use hiera rather than assigning variables in role classes (and
making tons of role classes based on realm/cluster/site/etc).

- Ryan
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] wmf getting ready for puppet3, advice please

2014-01-28 Thread Ariel T. Glenn
Στις 28-01-2014, ημέρα Τρι, και ώρα 10:21 -0800, ο/η Ryan Lane έγραψε:

 In puppet3 variables assigned in the node are still global. It's the only
 place other than facts (or hiera) that you can assign them and have their
 scope propagate. So, this'll continue working. I think the future path is
 surely to use hiera rather than assigning variables in role classes (and
 making tons of role classes based on realm/cluster/site/etc).

Sweet! I'd been going off the puppet whines in our logs, but after
seeing this message I hunted around, and looky there:

https://projects.puppetlabs.com/issues/14312

Thanks, puppet _





___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l