Puppet modules for deploying Apache in OpenStack infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

redirect.pp 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Define: httpd::vhost::redirect
  2. #
  3. # This class will create a vhost that does nothing more than redirect to a
  4. # given location
  5. #
  6. # Parameters:
  7. # $port:
  8. # Which port to list on
  9. # $dest:
  10. # Where to redirect to
  11. # - $vhost_name
  12. #
  13. # Actions:
  14. # Installs apache and creates a vhost
  15. #
  16. # Requires:
  17. #
  18. # Sample Usage:
  19. #
  20. define httpd::vhost::redirect (
  21. $port,
  22. $dest,
  23. $priority = '10',
  24. $serveraliases = undef,
  25. $template = 'httpd/vhost-redirect.conf.erb',
  26. $vhost_name = '*'
  27. ) {
  28. include ::httpd
  29. $srvname = $name
  30. file { "${priority}-${name}":
  31. path => "${httpd::params::vdir}/${priority}-${name}",
  32. content => template($template),
  33. owner => 'root',
  34. group => 'root',
  35. mode => '0755',
  36. require => Package['httpd'],
  37. notify => Service['httpd'],
  38. }
  39. if ! defined(Firewall["0100-INPUT ACCEPT ${port}"]) {
  40. @firewall {
  41. "0100-INPUT ACCEPT ${port}":
  42. jump => 'ACCEPT',
  43. dport => '$port',
  44. proto => 'tcp'
  45. }
  46. }
  47. }