Suppose you have several instances of the same resource, as follows:
package { 'php5-cli': ensure => installed, } package { 'php5-fpm': ensure => installed, } package { 'php-pear': ensure => installed, }
You can make your code shorter and simpler by grouping them into a single resource declaration with a list of names, as follows:
package { [ 'php5-cli', 'php5-fpm', 'php-pear' ]: ensure => installed, }
A comma-separated list in square brackets, shown in the following code line, is called an array:
[ 'php5-cli', 'php5-fpm', 'php-pear' ]
I've split it over multiple lines to make it more readable, but it's all the same to Puppet. Arrays are acceptable in many places where otherwise you might use a single value:
require => [ Package['ntp'], File['/etc/ntp.conf'] ],
And they are especially useful when declaring lots of instances of the same resource type, which only differ in their names:
file { [ '/var/www/myapp', ...