Project

General

Profile

Bug #2085

Classes import fails on first module with Puppet 3: Could not find value for $confdir

Added by Dominic Cleal over 6 years ago. Updated over 6 years ago.

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

Description

puppet.conf contains the following environment config and a single module exists under /etc/puppet/modules/development:

[development]
modulepath = /etc/puppet/modules/development:/etc/puppet/modules/common

The environment can be listed, but the class can't:

$ curl http://foreman:8443/puppet/environments
["development","production"]
$ curl http://foreman:8443/puppet/environments/development/classes
[]

The first search with PuppetClass.scan_manifest is always failing, so the first module found isn't getting parsed, only subsequent modules:

irb -I lib/ -rproxy
irb(main):001:0> Proxy::Puppet::PuppetClass.scan_directory('/etc/puppet/modules/development')
Error while parsing /etc/puppet/modules/development/test/manifests/init.pp: Could not parse for environment production: Error converting value for param 'manifest': Error converting value for param 'manifestdir': Could not find value for $confdir
=> []
irb(main):002:0> Proxy::Puppet::PuppetClass.scan_directory('/etc/puppet/modules/development')
=> [#<Proxy::Puppet::PuppetClass:0x7f416cb7e9e0 @params={"foo"=>"fqdn_rand(10, undef)"}, @klass="test">]

Associated revisions

Revision d58db757 (diff)
Added by Dominic Cleal over 6 years ago

fixes #2085 - load Puppet 3 app defaults for master mode too

Allows $confdir and other run mode specific settings to be initialised from
the defaults present in Puppet::Util::RunMode. When requesting detail on
classes, the Puppet parser indirectly requests app level settings so both
global and app settings are needed. Refactored into shared code for both
parser and environments to use.

History

#1 Updated by Alexander Litvinenko over 6 years ago

Also, when $confdir variable is used in puppet.conf, no environment is available at all - rake puppet:import:puppet_classes RAILS_ENV=production returns empry array.
Sample string in puppet.conf from Puppet Docs: modulepath = $confdir/environments/$environment/modules:$confdir/modules

http://docs.puppetlabs.com/guides/environment.html

#2 Updated by Dominic Cleal over 6 years ago

Alexander Litvinenko wrote:

Also, when $confdir variable is used in puppet.conf, no environment is available at all - rake puppet:import:puppet_classes RAILS_ENV=production returns empry array.
Sample string in puppet.conf from Puppet Docs: modulepath = $confdir/environments/$environment/modules:$confdir/modules

Has this worked for you before? I just tried Foreman 1.1 with Puppet 2.7.20 and it didn't work, so I'll probably call it a separate bug.

#3 Updated by Alexander Litvinenko over 6 years ago

No, it's just not working, and newer works earlier.

#4 Updated by Dominic Cleal over 6 years ago

  • Status changed from New to Assigned

Thanks - I've filed it as #2099, as it's a little different to the puppet 3 initialisation problem here.

#5 Updated by Dominic Cleal over 6 years ago

I'm considering this a blocker for 1.1 and have a proper solution in the works, but here's a quick hack for anybody who wants their proxy to work: http://people.redhat.com/~dcleal/2085_puppet3_temp_fix.patch

#6 Updated by Dominic Cleal over 6 years ago

  • Status changed from Assigned to Ready For Testing

#7 Updated by Dominic Cleal over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF