Ask Your Question

Why does this array variable not expand in package?

asked 2015-01-12 14:14:07 -0600

david.arnold gravatar image

I have been trying to get this to work today and I don't understand why it wont work. Can someone give me a hint please?

class omd {
  $prereqs = [
  package { ${prereqs} :
    ensure  => installed,

The error I get is: Could not parse for environment production: Could not match ${prereqs} at modules/omd/manifests/init.pp:25

Many thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-12 15:12:13 -0600

cbarbour gravatar image

Bare variables should not be surrounded by curly braces. Try this instead:

package { $prereqs:
  ensure  => installed,
edit flag offensive delete link more


Excellent. I thought I had tried that but obviously I had made an error somewhere. Your answer worked. Thank you for the help.

david.arnold gravatar imagedavid.arnold ( 2015-01-13 02:24:04 -0600 )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


Asked: 2015-01-12 14:14:07 -0600

Seen: 211 times

Last updated: Jan 12 '15