Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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",
- }
Advertisement
Add Comment
Please, Sign In to add comment