# Why does this array variable not expand in package?

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 = [ "debconf-2.0", "libapache2-mod-python", "libapache2-mod-php5", "php5-sqlite", "php5-mcrypt", "libgd2-xpm", "libdbi0", "libapache2-mod-proxy-html", "xinetd", "mysql-server", "graphviz", "dnsutils", "snmp", "fping", "smbclient", "unzip", "libnet-snmp-perl", "libxml-simple-perl", ] 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[K Many thanks edit retag close merge delete ## 1 Answer Sort by » oldest newest most voted Bare variables should not be surrounded by curly braces. Try this instead: package {$prereqs:
ensure  => installed,
}

more

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

( 2015-01-13 02:24:04 -0600 )edit

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

## Stats

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

Seen: 211 times

Last updated: Jan 12 '15