Issue #10651 has been updated by Ian Brandt.

>From an implementation standpoint I can't comment.  Speaking as a fairly green 
>user the above config seems easy enough to interpret based on [the Configuring 
>Puppet documentation](http://docs.puppetlabs.com/guides/configuring.html).

The module path used by an agent in the "dev" environment (or by the master 
when it serves an agent in the dev environment) would be `/foo/bar:/xylophone`. 
 For "test" it's `/foo/bar:/yak`, and for "prod" it's `/foo/bar:/zootsuit`.  
I'm less familiar with Puppet in these scenarios, but I would assume:

* `/foo/bar:/baz` would be used by the master itself on startup (if it uses 
`modulepath` at that time).
* `/foo/bar` would be used for the agent and its master when no environment is 
set (as it would default to "production", which would have no matching block 
declared in the config).
* `/foo/bar` would similarly be used for the agent and its master when a 
non-declared environment is set.

If I'm wrong on any of that I'd first blame ignorance with regard to puppet and 
its configuration in general.  I don't see recursive variable interpolation 
adding any significant barrier to comprehension.  As Nick pointed out maybe 
that's just because I'm familiar with much more involved interpolation schemes 
in Unix shells and the like, but as a feature I can always opt not to use it if 
it poses a problem.  Now that said I understand the motivation to keep the 
surface area of a technology as small as possible.  I just don't see ordering 
and recursive variable interpolation as all that complicated or magical.  In 
fact I find them to be so common elsewhere I implicitly expect them to be 
available if there is variable interpolation at all, hence this bug report.  
Not to go off topic, but it's the lack of ordering elsewhere in Puppet that 
I've found less intuitive--my current `requires`, `before`, `subscribe` and 
Autorequires `--graph`... now there be dragons and magic.
----------------------------------------
Feature #10651: Allow the default modulepath in puppet.config to be augmented
https://projects.puppetlabs.com/issues/10651

Author: Ian Brandt
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: 
Target version: 
Affected Puppet version: 2.7.6
Keywords: 
Branch: 


With my puppet.config as follows:

    [main]
    modulepath = $modulepath:/my/module/path

I find `:/my/module/path` is simply dropped:

    $ puppet apply -e 'notice("$settings::modulepath")'
    notice: Scope(Class[main]): 
/Users/ibrandt/.puppet/modules:/usr/share/puppet/modules
    notice: Finished catalog run in 0.02 seconds

I've tried several variations:

    [main]
    modulepath = ${modulepath}:/my/module/path

...

    $ puppet apply -e 'notice("$settings::modulepath")'
    err: Could not parse /Users/ibrandt/.puppet/puppet.conf: Could not parse 
'${modulepath}:/my/module/path'
    notice: Scope(Class[main]): 
/Users/ibrandt/.puppet/modules:/usr/share/puppet/modules
    notice: Finished catalog run in 0.02 seconds

And:

    [main]
    modulepath = ${settings::modulepath}:/my/module/path

...

    $ puppet apply -e 'notice("$settings::modulepath")'
    err: Could not parse /Users/ibrandt/.puppet/puppet.conf: Could not parse 
'${settings::modulepath}:/my/module/path'
    notice: Scope(Class[main]): 
/Users/ibrandt/.puppet/modules:/usr/share/puppet/modules
    notice: Finished catalog run in 0.02 seconds

And:

    [main]
    modulepath = $settings::modulepath:/my/module/path

...

    $ puppet apply -e 'notice("$settings::modulepath")'
    Could not prepare for execution: Could not find value for $settings

And:

    [main]
    modulepath = /my/module/path:${modulepath}

...

    $ puppet apply -e 'notice("$settings::modulepath")'
    err: Could not parse /Users/ibrandt/.puppet/puppet.conf: Could not parse 
'/my/module/path:${modulepath}'
    notice: Scope(Class[main]): 
/Users/ibrandt/.puppet/modules:/usr/share/puppet/modules
    notice: Finished catalog run in 0.02 seconds

And:

    [main]
    modulepath = /my/module/path:$modulepath

...

    $ puppet apply -e 'notice("$settings::modulepath")'
    /Users/ibrandt/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/sync.rb:214:in 
`sync_unlock': stack level too deep (SystemStackError)
    from /Users/ibrandt/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/sync.rb:232:in 
`synchronize'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/settings.rb:661:in
 `uninterpolated_value'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/settings.rb:811:in
 `each_source'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/settings.rb:808:in
 `each'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/settings.rb:808:in
 `each_source'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/settings.rb:658:in
 `uninterpolated_value'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/settings.rb:657:in
 `catch'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/settings.rb:657:in
 `uninterpolated_value'
    ... 2790 levels...
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/lib/puppet/util/command_line.rb:69:in
 `execute'
    from 
/Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/gems/puppet-2.7.6/bin/puppet:4
    from /Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/bin/puppet:19:in `load'
    from /Users/ibrandt/.rvm/gems/ruby-1.8.7-p352@etp/bin/puppet:19
    
And:

    [main]
    defaultmodulepath = $modulepath
    modulepath = $defaultmodulepath:/my/module/path

...

    $ puppet apply -e 'notice("$settings::modulepath")'
    Could not prepare for execution: Could not find value for $defaultmodulepath



-- 
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.

Reply via email to