puppet forge module puppetlabs-puppetdb

85 views
Skip to first unread message

Peter Berghold

unread,
Jun 12, 2014, 8:10:30 AM6/12/14
to puppet-users
Trying to use the puppetlabs-puppetdb module to set up my puppet master to use stored configs using puppetdb along side foreman.

In a config group I dropped it class puppetb and puppetdb::master::config.  

Here's the error I'm seeing:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Class[Puppetdb::Database::Postgresql] is already declared; cannot redeclare at /etc/puppet/environments/production/modules/puppetdb/manifests/init.pp:108 on node mcadprod1.mca.sharkrivertech.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

is there a work around for ths?


--

Peter L. Berghold                       Salty....@gmail.com

http://blog.berghold.net

Ken Barber

unread,
Jun 12, 2014, 8:30:13 AM6/12/14
to Puppet Users
> Trying to use the puppetlabs-puppetdb module to set up my puppet master to
> use stored configs using puppetdb along side foreman.
>
> In a config group I dropped it class puppetb and puppetdb::master::config.
>
> Here's the error I'm seeing:
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Duplicate declaration: Class[Puppetdb::Database::Postgresql] is already
> declared; cannot redeclare at
> /etc/puppet/environments/production/modules/puppetdb/manifests/init.pp:108
> on node mcadprod1.mca.sharkrivertech.com
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> is there a work around for ths?

The error is pretty clear, we have a duplicate class defined
somewhere. Now introducing the class 'puppetdb' and
'puppetdb::master::config' together should not cause a conflict, so I
can only presume you have 'puppetdb::database::postgresql' defined
somewhere else. Can you double check and make sure this isn't
happening? Test the two classes for the node on their own for example
(without your other ENC classes for example, not sure how quite to do
this in foreman) and you should see them working fine.

ken.

Tom Verdaat

unread,
Jun 12, 2014, 8:40:33 AM6/12/14
to puppet...@googlegroups.com
Looks vaguely familiar.

Using the puppetdb and postgresql master branches from github and this is all I've got:

  class { 'puppetdb': }
  class { 'puppetdb::master::config':
    puppet_service_name         => 'apache2',
    require                     => Class['puppetdb'],
  }

Works fine with Foreman. Like Ken Barber just mentioned: check if there is no other reference to Puppetdb::Database::Postgresql in your manifests.

Tom




Op donderdag 12 juni 2014 14:10:30 UTC+2 schreef Salty Old Cowdawg:

Ken Barber

unread,
Jun 12, 2014, 8:57:42 AM6/12/14
to Puppet Users
> Using the puppetdb and postgresql master branches from github and this is
> all I've got:
>
> class { 'puppetdb': }
> class { 'puppetdb::master::config':
> puppet_service_name => 'apache2',
> require => Class['puppetdb'],
> }
>
> Works fine with Foreman. Like Ken Barber just mentioned: check if there is
> no other reference to Puppetdb::Database::Postgresql in your manifests.

Thanks for confirming this Tom.

Peter, I think you can look at what classes are being pulled into the
node from Foreman by perhaps calling the ENC script for foreman on the
command line, it should give you back some YAML with a list of classes
and their parameters. If you can't find the duplicate yourself - by
analyzing that output and seeing what other classes are being pulled
in implicitly it might give you a better idea. I can't recall how to
do this for foreman exactly, but anyone who knows Foreman should be
able to chime in, perhaps provide other suggestions for finding
how/why/what classes are being classified for a particular node.

ken.

Gavin Williams

unread,
Jun 12, 2014, 9:15:22 AM6/12/14
to puppet...@googlegroups.com
You can do it through the Foreman UI.

Select the node in question, and then hit the 'YAML' button under 'Properties' -> 'Details'.

HTH

Gav
Reply all
Reply to author
Forward
0 new messages