Issue #11900 has been updated by Nigel Kersten.
eric sorenson wrote:
> > Is it possible for you to generate directories based upon the possible
> > values of the two keys? Do you know what they all would be?
>
> Could be, but that's another step to lookup isn't it? Where is the hook to do
> that step?
cron? VCS hook? It depends where your source of truth is about these keys.
>
> > Ultimately it would be quite awesome if we could simply set manifest and
> > modulepath in an ENC... but you'd have to accept that you'd get:
> >
> > * fact values from existing facts
> > * ENC determines modulepath for pluginsyncing facts
> > * fact values from pluginsynced facts.
> >
> > which could be rather frustrating, not being able to make modulepath
> > decisions based upon facts in modules...
>
> That would actually all be wonderful, because I am a source-of-truth
> absolutist: I think if you're using an ENC, you're doing so because you have
> your business logic in an external source-of-truth and therefore you can (&&
> should) make *all* your decisions with that same mechanism. As I understand
> it now, ENC determination happens after / as a result of puppet.conf
> evaluation and therefore the situation's backwards from this bulleted list.
But you'd be perfectly happy not being able to use any custom facts to
determine the modulepath for a fresh host?
I don't think an external source of truth is the only reason to use an ENC.
You may find it more flexible as a source of truth than node {} declarations in
your manifests.
For others reading this thread, it also may not be obvious that you can set
your environment agent-side with a custom fact that returns `environment` and
not set it in the agent puppet.conf if you want.
----------------------------------------
Feature #11900: Dynamic environment interpolation in puppet master configuration
https://projects.puppetlabs.com/issues/11900
Author: Mike McLane
Status: Needs More Information
Priority: Normal
Assignee: Kelsey Hightower
Category: server
Target version:
Affected Puppet version: development
Keywords: dynamic environment, puppet master configuration, interopolated
configuration, environment parameter
Branch:
In providing a single Puppet master to multiple teams, where each team has
their own test/release cadence, we maintain that each team would like to
include their own dynamic module path based on the environment passed from the
agent. We have a re-usability case where an enterprise level of common modules
is provided at the lowest path inclusion priority, the local team has a set of
common modules at the next highest level of include priority, and then the
dynamic environment has the highest level of inclusion priority. This allows
for development and testing cases to be carried out through dynamic pulls of
environment-labeled branches in git.
Some form of regex matching of the environment to the configuration section,
might help in this regard.
In such a setup it would be nice to configure a puppet master as:
<pre>
[teama*]
manifest = $confdir/environments/manifests/teamb/$environment/site.pp
modulepath =
$confdir/environments/modules/teamb/$environment/:$confdir/common/modules/teamb/:$confdir/common/modules/enterprise/
[teamb*]
manifest = $confdir/environments/manifests/teama/$environment/site.pp
modulepath =
$confdir/environments/modules/teama/$environment/:$confdir/common/modules/teama/:$confdir/common/modules/enterprise/
</pre>
...or, alternatively.. such a case where the environment passed in is parsed
within the configuration, allowing config-file variables to be set as such:
<pre>
[production]
# passed in $environment = "team-production-product"
$group = $environment.split("-")[0]
# $releasecycle = $environment.split("-")[1]
# $product = $environment.split("-")[2]
manifest = $confdir/environments/manifests/$group/$environment/site.pp
modulepath =
$confdir/environments/modules/$group/$environment/:$confdir/common/modules/$group/:$confdir/common/modules/enterprise/
</pre>
Within the base environments path, I would initialize the directory as a git
repository and keep a post-receive wrapper script to dynamically fetch
environments based on the $environment path.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.