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.

proxy.pp 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Define: httpd::vhost::proxy
  2. #
  3. # Configures an apache vhost that will only proxy requests
  4. #
  5. # Parameters:
  6. # * $port:
  7. # The port on which the vhost will respond
  8. # * $dest:
  9. # URI that the requests will be proxied for
  10. # - $priority
  11. # - $template -- the template to use for the vhost
  12. # - $vhost_name - the name to use for the vhost, defaults to '*'
  13. #
  14. # Actions:
  15. # * Install Apache Virtual Host
  16. #
  17. # Requires:
  18. #
  19. # Sample Usage:
  20. #
  21. define httpd::vhost::proxy (
  22. $port,
  23. $dest,
  24. $priority = '10',
  25. $template = 'httpd/vhost-proxy.conf.erb',
  26. $servername = '',
  27. $serveraliases = '',
  28. $ssl = false,
  29. $vhost_name = '*'
  30. ) {
  31. include httpd
  32. $apache_name = $httpd::params::apache_name
  33. $ssl_path = $httpd::params::ssl_path
  34. if $servername == '' {
  35. $srvname = $name
  36. } else {
  37. $srvname = $servername
  38. }
  39. if $ssl == true {
  40. include httpd::ssl
  41. }
  42. file { "${priority}-${name}":
  43. path => "${httpd::params::vdir}/${priority}-${name}",
  44. content => template($template),
  45. owner => 'root',
  46. group => 'root',
  47. mode => '0755',
  48. require => Package['httpd'],
  49. notify => Service['httpd'],
  50. }
  51. }