Project

General

Profile

Actions

Bug #2085

closed

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

Added by Dominic Cleal almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet
Target version:
Difficulty:
Triaged:
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">]
Actions #1

Updated by Alexander Litvinenko almost 12 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

Actions #2

Updated by Dominic Cleal almost 12 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.

Actions #3

Updated by Alexander Litvinenko almost 12 years ago

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

Actions #4

Updated by Dominic Cleal almost 12 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.

Actions #5

Updated by Dominic Cleal almost 12 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

Actions #6

Updated by Dominic Cleal almost 12 years ago

  • Status changed from Assigned to Ready For Testing
Actions #7

Updated by Dominic Cleal almost 12 years ago

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

Also available in: Atom PDF