Project

General

Profile

Actions

Bug #1994

closed

Puppet 3: $vardir also has to be set or it fails to interpolate

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet integration
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

With Puppet 3, we call the initialize_global_settings method with the --confdir and the value of the :puppetconfdir setting. However if the puppet.conf references $vardir (which settings do by default) then --vardir also has to be set when we initialise Puppet.

As mentioned in Jeff's comment here, this had to be added to the puppet config.ru for 3.0.1 too:
http://projects.puppetlabs.com/issues/16637#note-9

This is equivalent to how we initialise Puppet 3 today, which throws an error:

irb(main):001:0> require 'puppet'
=> true
irb(main):002:0> Puppet.settings.initialize_global_settings(['--confdir', '/etc/puppet', '--run_mode', 'master'])
=> true
irb(main):003:0> puts Puppet[:hostcert]
Puppet::Settings::InterpolationError: Error converting value for param 'hostcert': Error converting value for param 'certdir': Error converting value for param 'ssldir': Could not find value for $vardir
Other minor related problems:
  1. :puppetconfdir is actually pointing to /etc/puppet/puppet.conf usually, so this should really be --conf rather than confdir
  2. :puppetconfdir was removed in 7c08e30a47a16d387f26d1c617cdedc60d9d0582
  3. missing comma in my commit inside '--run_mode' 'master'

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #1872: Puppet and foreman 3.0 Do not play well togetherClosedSam Kottler09/19/2012Actions
Actions #1

Updated by Dominic Cleal over 11 years ago

  • Status changed from New to Assigned
  • Assignee changed from Ohad Levy to Dominic Cleal

I don't particularly like the idea of having a Foreman setting for the Puppet vardir as it feels we're getting too internal. Perhaps this will go away with the refactor of Puppet settings in 3.1.

I'm going to try replacing this with simple calls to `puppet master --configprint` (or `puppetmasterd` as appropriate), which will work consistently across all versions and avoid getting into Puppet's application initialisation logic.

Actions #2

Updated by Dominic Cleal over 11 years ago

":puppetconfdir was removed in 7c08e30a47a16d387f26d1c617cdedc60d9d0582"

This is causing the following error:

Error parsing arguments
/home/bretw/src/foreman/vendor/ruby/1.8/gems/puppet-3.0.1/lib/puppet/util/command_line/puppet_option_parser.rb:78:in `parse'
/home/bretw/src/foreman/vendor/ruby/1.8/gems/puppet-3.0.1/lib/puppet/settings.rb:183:in `parse_global_options'
/home/bretw/src/foreman/vendor/ruby/1.8/gems/puppet-3.0.1/lib/puppet/settings.rb:146:in `initialize_global_settings'
/home/bretw/src/foreman/lib/foreman/default_settings/loader.rb:27:in `load'

(as reported in foreman-users: Trying to get Foreman working with Puppet 3)

Actions #3

Updated by Dominic Cleal over 11 years ago

Specifying vardir is unavoidable with Puppet 3, since we call Puppet as a non-root user (see #16637), so I've added a "puppetvardir" setting to settings.yaml, which defaults to /var/lib/puppet.

https://github.com/theforeman/foreman/pull/280

Actions #4

Updated by Dominic Cleal over 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF