Guest User

Untitled

a guest
May 1st, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. define apache2::module($ensure = present) {
  2. case $ensure {
  3. present: {
  4. exec { "Enable Apache module $name":
  5. command => "/usr/sbin/a2enmod $name",
  6. }
  7. }
  8. absent: {
  9. exec { "Disable Apache module $name":
  10. command => "/usr/sbin/a2dismod $name",
  11. }
  12. }
  13. default: {
  14. fail "Invalid 'ensure' value '$ensure' for apache2::module"
  15. }
  16. }
  17. }
  18.  
  19. # Fails with:
  20. # err: //Apache2::Module[php5]/Exec[Enable Apache module php5]/returns: change from notrun to 0 failed:
  21. apache2::module { "php5": }
  22.  
  23. # Works:
  24. # notice: //Exec[global scope: Enable Apache module php5]/returns: executed successfully
  25. exec { "global scope: Enable Apache module php5":
  26. command => "/usr/sbin/a2enmod php5",
  27. }
Advertisement
Add Comment
Please, Sign In to add comment