I've got a seemingly impossible error in a very simple puppet manifest. I'm simply trying to use the example42 puppet-puppet module to run puppetmaster (with puppet 3.1.0). This is my site.pp:

node 'se2' { 
    class { 'puppet::server' :
        mode => 'server' }    
Exec { path => "/usr/bin:/usr/sbin:/bin:/sbin" }
node default { }

With this, I get the error:

Info: Loading facts in /var/lib/puppet/lib/facter/last_run.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppi_projects.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter mode at /etc/puppet/manifests/site.pp:7 on node se2

(line 7 is the line with mode)

There must be something stupid I'm doing, from what I can see here, mode IS a valid parameter:


Any suggestions?


You are referencing server.pp by calling puppet::server

See this class for puppet::server https://github.com/example42/puppet-puppet/blob/master/manifests/server.pp

To reference the class with parameter 'mode', use puppet.pp:

node 'se2' { 
  class { 'puppet' :
    mode => 'server',
Exec { path => "/usr/bin:/usr/sbin:/bin:/sbin" }
node default { }
  • I think I'm misunderstanding how inherit works in this case. Does the line: class puppet::server inherits puppet Not also pull in the parameterization directives from the puppet class? Being new to puppet, I'd think that it does the OOP thing and makes puppet::server do everything puppet can do. – PerilousApricot Feb 28 '13 at 11:15
  • Hey, sorry I missed this notification. class puppet::server inherits puppet does not pull in the parameterization directives. Instead, it acts as an include while also allowing resource overrides. For example, you could override the puppet.conf resource like so: File[ 'puppet.conf'] { path => '/someotherpath', } If you do want to access parameters from another class, you can accomplish this through namespacing. $::puppet::mode would give you the puppet class mode parameter. – Evan Apr 2 '13 at 17:04

Near the bottom of that page is this:

### PuppetMaster configuration
if $puppet::mode == 'server' {
  include puppet::server

But your class is already puppet::server. I'm not overly familiar with writing providers but a class including itself doesn't seem likely to work. Can you try making your class have a different name?

  • Not for this specific module, according to the linked source code. – Sven Feb 26 '13 at 16:25
  • @SvenW Ah, my mistake. I didn't really read that page, only one part of it. I think I may see the problem now. – Ladadadada Feb 26 '13 at 17:59
  • I'm not trying to make a class called puppet::server, I'm simply trying to pull in the one from that module. The baby steps in puppet are super difficult :/ – PerilousApricot Feb 27 '13 at 18:44
  • Indeed. Good luck with it. All I can at this point is "It's not just you." – Ladadadada Feb 27 '13 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.