Always end lines that declare parameters with a comma, even if it is the last parameter:
service { 'memcached':
ensure => running,
enable => true,
}
This is allowed by Puppet, and makes it easier if you want to add parameters later, or reorder the existing parameters.
When declaring a resource with a single parameter, make the declaration all on one line and with no trailing comma, as shown in the following snippet:
package { 'puppet':
ensure => installed
}
Where there is more than one parameter, give each parameter its own line:
package { 'rake':
ensure => installed,
provider => gem,
require => Package['rubygems'],
}
To make the code easier to read, line up the parameter arrows in line with the longest parameter, as follows:
file { "/var/www/${app}/shared/config/rvmrc":
owner => 'deploy',
group => 'deploy',
content => template('rails/rvmrc.erb'),
require => File["/var/www/${app}/shared/config"],
}
The arrows should be aligned per resource, but not across the whole file, otherwise it may be difficult for you to cut and paste code from one file to another.