Ask Your Question

Duplicate declaration errors

asked 2016-01-25 17:49:08 -0600

johntest gravatar image

I am trying to do this

class installzabbix ()
 class { 'enablerepo::zabbix' }->
 class { 'haproxy::zabbix': }->
 class { 'zabbix::server': }->
 class { 'pacemaker::zabbix': }

This is resulting in duplicate declaration errors such as

Error: Duplicate declaration: Service[zabbix-server] is already declared in file /etc/puppet/modules/zabbix/init.pp:34; cannot redeclare at /etc/puppet/modules/pacemaker/init.pp:25 on node testsystem.local

There are many more. The classes are created to work on their own. Is there any way to get the parser to ignore duplicate decs? If not, what can I do here?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-25 23:53:25 -0600

There's not a lot you can do here, other than to "fix" the modules/classes so that they can be run on the same node. If they're not your own modules, you'll probably need to discuss with the module authors this limitation by raising issues against their projects on Github.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2016-01-25 17:49:08 -0600

Seen: 464 times

Last updated: Jan 25 '16