Ask Your Question
0

How should one handle »Duplicate declarations« between Forge modules?

asked 2016-07-20 03:23:57 -0500

Erik gravatar image

updated 2016-07-20 03:24:35 -0500

I'm new to puppet and encountered the problem, that even in simple scenarios modules seem not work together. For example, I want to use NIS and NFS and installed the popular modules from forge ericsson-nisclient und derdanne-nfs. This leads to this error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: Service[rpcbind] is already declared in file /etc/puppetlabs/code/environments/testing/modules/rpcbind/manifests/init.pp:83; cannot redeclare at /etc/puppetlabs/code/environments/testing/modules/nfs/manifests/client/service.pp:43:5 on node test.local

When using desalvo-nis instead of ericsson-nisclient, there is a conflict with ghoneycutt-nsswitch.

My question is: what is the approved way to avoid these conflicts? I want to use puppet forge modules, because I don't want to reinvent the wheel.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-09-04 06:11:00 -0500

updated 2016-12-25 15:09:15 -0500

There's AFAIK no „approved“ way. Both ericsson-nisclient and derdanne-nfs like to manage Service['rpcbind'] but only one is allowed to.

Thinkable resolutions would have been

  • one or both modules provide a class parameter, let's say manage_rpcbind_service, which let's you disable them declaring Service['rpcbind']
  • there's just a single rpcbind module the modules rely on

I think the most practicable way for you, would be writing a module just fitting your scenario and use at most one of the modules which doesn't introduce conflicts.

Of course you can look, whether just commenting out the one of resource declarations solves the problem. But that's definitely not an approved way.

edit flag offensive delete link more

Comments

Thank you for the clarification! I've ended up with using a patched echocat-nfs.

Erik gravatar imageErik ( 2017-01-02 04:08:35 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-07-20 03:23:57 -0500

Seen: 300 times

Last updated: Dec 25 '16