First page Back Continue Last page Overview Graphics
Classes and Definitions
Classes are groups of resources.
Definitions are similar to classes, but they can be instantiated multiple times with different arguments on the same node.
class apache2 {
define simple-vhost ( $admin = "webmaster", $aliases, $docroot) {
file { "/etc/apache2/sites-available/$name":
mode => "644",
require => [ Package["apache2"], Service["apache2"] ],
content => template("apache/vhost.conf"),
} } }
node debiantest {
- include apache2
- apache2::simple-vhost { "debian.example.com": docroot => "/var/www/debian"}
- apache2::simple-vhost { "test.example.com": docroot => "/var/www/test"}
}