Project

General

Profile

Feature #1029

Allow custom variables to be queried from a puppet function

Added by Marcello de Sousa about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
External Nodes
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

The new custom variables and multiple values resolved should be available via a puppet function (similar to extlookup).

Example usage in puppet code (with function name -> "foremanextvar"):

foremanextvar (<variable>, <default_value>, <comment>, <paramfile_with_extra_options> )

This way we could achieve the following:
- manage the variables in foreman
- query them from puppetcode
- Add metadata (for ex. "comment")
- have forward and backwards compatibility with core puppet functions (using the "default_value" field).
Example (with extlookup fallback compatibility and comment):

$ntpd_options   =  foremanextvar (ntpd_options, extlookup (ntpd_options), "oracle needs -o in RAC environments" )

Note: This implementation would also require a way to enable/disable the params from adding to the enc yaml (something to avoid puppet errors complaining the variable is already defined.)

Associated revisions

Revision 86d01ac3 (diff)
Added by Ohad Levy about 8 years ago

fixes #1029 - allows smart variables to be resolved via http get request.

this would allow to an external query to resolve a variable value to a given host.

e.g.
http://foreman/hosts/&lt;fqdn&gt;/lookup_values/&lt;variable_name>

Revision 0a492999 (diff)
Added by Ohad Levy about 8 years ago

Puppet function to query foreman smart variables, refs #1029

Revision 14cd3f28 (diff)
Added by Ohad Levy about 8 years ago

updated foreman puppet module to include the smart variables puppet function

this also ensures that the json response from foreman is always in json.

refs #1029

History

#1 Updated by Ohad Levy about 8 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF