The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Feature #5613

Appending to Variables in a global context

Added by Spenser Gilliland over 5 years ago. Updated almost 3 years ago.

Status:Needs More InformationStart date:12/20/2010
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected Puppet version: Branch:
Keywords:exported variables, globals, collections, query

We've Moved!

Ticket tracking is now hosted in JIRA:


I’d like a syntax style for returning an array in a global context.

IE: class redmine { instances = [] } define redmine::instance { instances += “name” }

Or another possible syntax style.

class redmine { instances = array_element <<| tag = “$fqdn” |>> }

define redmine { array_element{“$name”: tag => “$fqdn”} }

These would ideally both create an array of the defined instances names.

I describe the use case in this email thread in greater detail.


#1 Updated by James Turnbull over 5 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Nigel Kersten

#2 Updated by Nigel Kersten over 4 years ago

  • Status changed from Needs Decision to Needs More Information
  • Assignee changed from Nigel Kersten to Anonymous

Daniel, I saw you comment on the original thread that you had a similar need.

Can you elaborate on that?

#3 Updated by Anonymous over 4 years ago

Nigel Kersten wrote:

Daniel, I saw you comment on the original thread that you had a similar need. Can you elaborate on that?

I had problems along the lines of “enumerate all nodes for the backup system”, or “list all application servers for web app X on the load balancer”. We generally solved those with either concat, custom code building out the file on the target machine, or collecting files on the master and using generate to combine them into a single variable in Puppet.

#4 Updated by Henrik Lindberg over 3 years ago

  • Keywords changed from exported variables, globals to exported variables, globals, collections

This is part of a larger theme: added keyword collections

#5 Updated by Anonymous almost 3 years ago

  • Assignee deleted (Anonymous)

#6 Updated by Henrik Lindberg almost 3 years ago

  • Keywords changed from exported variables, globals, collections to exported variables, globals, collections, query

Updated keywords as this relates to query. There is functionality discussed in this area in ARM-8. Daléns puppet db query module with functions for querying PuppetDB also sounds like a solution.

Also available in: Atom PDF