Feature #5526

API call to return list of available environments

Added by James Turnbull over 1 year ago. Updated about 1 year ago.

Status:Accepted Start date:12/13/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:API
Target version:-
Affected Puppet version: Branch:
Keywords:API introspection environment ENC
Votes: 1

Description

Usage: Would like to make an API call as a validation to an ENC to return a list of valid environments:

Story: Bob has an ENC in a web interface and wants to add a node to an environment. He sets the environment setting to “testing” but has no idea until he runs the ENC if the “testing” environment exists. Instead he’d like his web interface to query the Puppet master and return a list of valid environments so he can validate that the “testing” environment exists.


Related issues

related to Puppet - Feature #5527: API call to return list of available classes in an enviro... Accepted 12/13/2010
related to Puppet Dashboard - Feature #6608: Dashboard should be aware of Puppet environments Accepted 03/05/2011

History

Updated by Nigel Kersten over 1 year ago

  • Status changed from Needs Decision to Accepted

Updated by Nigel Kersten over 1 year ago

  • Assignee deleted (Nigel Kersten)

I’ve been thinking about this for a while, about how we can reconcile this feature request with the desire for people to have dynamic environment definitions with the $environment variable in modulepath/manifest etc.

How about we produce an “environmentsdir” parameter that expects the following structure?

$manifest = $enivornmentsdir/manifest/site.pp
$modulepath = $environmentsdir/modules

We’re kind of inconsistent with $fooPATH and $foodir. I’m not sure which one we should settle on.

Updated by Alan Barrett over 1 year ago

Nigel Kersten wrote:

How about we produce an “environmentsdir” parameter that expects the following structure?

Could you explain this idea in more detail?

We’re kind of inconsistent with $fooPATH and $foodir. I’m not sure which one we should settle on.

I’d suggest using “dir” when it’s a directory, and “path” when it’s a list of directories. modulepath is a list.

Updated by Alan Barrett over 1 year ago

Nigel Kersten wrote:

I’ve been thinking about this for a while, about how we can reconcile this feature request with the desire for people to have dynamic environment definitions with the $environment variable in modulepath/manifest etc.

There’s already an “environments” setting in puppet.conf. If you add an API call to retrieve it, you don’t lose anything.

I wish I could embed $environment in the value of $manifest, but that seems orthogonal to whether or not I keep an exhaustive list of valid environments.

Also available in: Atom PDF