Page MenuHomePhabricator

puppet: remove cluster variable
Closed, ResolvedPublic

Description

while reviewing a change I noticed a comment from @Joe pointing out that lookups for the cluster hiera value need to pass the global $::cluster variable as a default. The use of a global value instead of a hiera default seemed odd to me and the fact that both the global value and the hiera key are named the same seemed a bit confusing.

Looking at the code it seems that we could get rid of the global cluster variable if we simply add a default to labs.yaml and comon.yaml, although i suspect I'm missing some historical context :). Or possibly this was needed before the hiera search order was changed

Event Timeline

Change 541213 had a related patch set uploaded (by Jbond; owner: John Bond):
[operations/puppet@production] puppet: change $::cluster variable to a hiera default

https://gerrit.wikimedia.org/r/541213

The reason for the presence of the global variable was that, back in the day, it was the only way to inject the "cluster" in WMCS VMs. Nowadays they can all use hiera so that should not be a problem anymore.

The reason for the presence of the global variable was that, back in the day, it was the only way to inject the "cluster" in WMCS VMs. Nowadays they can all use hiera so that should not be a problem anymore.

Thanks Joe, as recommended, i have added Andrew and Arturo to the change to confirm it is not needed

jbond triaged this task as Medium priority.Oct 7 2019, 2:15 PM
jbond added a project: Cloud-Services.
Penggang1 set Due Date to Oct 7 2019, 4:00 PM.
Penggang1 removed subscribers: fgiunchedi, Joe, Aklapper, jbond.
Reedy removed Due Date.
Reedy added subscribers: fgiunchedi, Joe, Aklapper, jbond.

Change 541213 merged by Jbond:
[operations/puppet@production] puppet: change $::cluster variable to a hiera default

https://gerrit.wikimedia.org/r/541213