
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.75 KB | hits: 14 | expires: Never
define apache2::module($ensure = present) {
case $ensure {
present: {
exec { "Enable Apache module $name":
command => "/usr/sbin/a2enmod $name",
}
}
absent: {
exec { "Disable Apache module $name":
command => "/usr/sbin/a2dismod $name",
}
}
default: {
fail "Invalid 'ensure' value '$ensure' for apache2::module"
}
}
}
# Fails with:
# err: //Apache2::Module[php5]/Exec[Enable Apache module php5]/returns: change from notrun to 0 failed:
apache2::module { "php5": }
# Works:
# notice: //Exec[global scope: Enable Apache module php5]/returns: executed successfully
exec { "global scope: Enable Apache module php5":
command => "/usr/sbin/a2enmod php5",
}