Ask Your Question
0

how to create manifest with multiple instances?

asked 2013-03-06 14:55:06 -0500

redgoal gravatar image

updated 2013-04-13 15:31:40 -0500

ramindk gravatar image

I am trying to create a defined type where service A has multiple properties. When I try to run it with puppet apply , I get "duplicate parameter" error. I have to put all the parameters in a manifest to make this service run. What can I do in this situation?

edit retag flag offensive close merge delete

Comments

2

Can you put the code and the error into your post, or into a gist/pastie and put the link in your question?

llowder gravatar imagellowder ( 2013-03-06 16:20:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-06-20 16:48:15 -0500

Steve Shipway gravatar image

I think you need to make the property an array, rather than mention it multiple times. If you want a parameter to have multi values, you cannot specify it multiple times.

For example, say this is your define:

define foo($param='') {
  notify { "notify-${name}": message=>"I have param ${param}"; }
}

Then, you can do this:

foo { myname: param=>'bar'; }

but you CANNOT do this:

foo { myname: param=>'bar', param=>'baz'; }

Now, if you use an array paramter like this:

define foo($param=[]) {
  $allparam = join($param, ",")
  notify { "notify-${name}": message=>"I have param ${allparam}"; }
}

then you can send single parameters....

foo { myname ...
(more)
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

1 follower

Stats

Asked: 2013-03-06 14:55:06 -0500

Seen: 251 times

Last updated: Jun 20 '13