Feature #5526
API call to return list of available environments
| 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
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.