Duplicate declaration on Puppet server

puppet

I can't override parameters of a class in my manifest. Puppet version on both machines is 3.7.5. I use thias-postfix. I even can't execute the example from the Readme.MD file.
Below is my site.pp manifest:

node default {}

node "subscriber" {
  Exec{path => "/usr/bin:/usr/sbin:/bin:/sbin"}

  include postfix::server  

  class {'::postfix::server':
  ...
  }

}

When executing on "subscriber" node, I get the following:

Error: couldn't retrieve catalog from remote server:
Error 400 on SERVER:
Duplicate declaration: Class[Postfix::Server] is already declared;
cannot redeclare at /etc/puppet/manifests/site.pp: *XX* on node subscriber
Warning: Not using cache on failed catalog
Error: Couldn't retrieve catalog; skipping run

Best Answer

You basically declared postfix::server twice.
Once by including it and again by declaring class { '::postfix::server':.
The example does not mention the include, you should remove it.
Also read: puppet labs

Related Topic