How to fix invalid parameter errors in puppet manifests

puppetpuppetmaster

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:

https://github.com/example42/puppet-puppet/blob/master/manifests/init.pp#L320

Any suggestions?

Best Answer

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 { }