common.pp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # == Class: nova::vncproxy::common
  2. #
  3. # [*vncproxy_host*]
  4. # (optional) The host of the VNC proxy server
  5. # Defaults to false
  6. #
  7. # [*vncproxy_protocol*]
  8. # (optional) The protocol to communicate with the VNC proxy server
  9. # Defaults to 'http'
  10. #
  11. # [*vncproxy_port*]
  12. # (optional) The port to communicate with the VNC proxy server
  13. # Defaults to '6080'
  14. #
  15. # [*vncproxy_path*]
  16. # (optional) The path at the end of the uri for communication with the VNC proxy server
  17. # Defaults to '/vnc_auto.html'
  18. #
  19. class nova::vncproxy::common (
  20. $vncproxy_host = undef,
  21. $vncproxy_protocol = undef,
  22. $vncproxy_port = undef,
  23. $vncproxy_path = undef,
  24. ) {
  25. include ::nova::deps
  26. $vncproxy_host_real = normalize_ip_for_uri(pick(
  27. $vncproxy_host,
  28. $::nova::compute::vncproxy_host,
  29. $::nova::vncproxy::host,
  30. false))
  31. $vncproxy_protocol_real = pick(
  32. $vncproxy_protocol,
  33. $::nova::compute::vncproxy_protocol,
  34. $::nova::vncproxy::vncproxy_protocol,
  35. 'http')
  36. $vncproxy_port_real = pick(
  37. $vncproxy_port,
  38. $::nova::compute::vncproxy_port,
  39. $::nova::vncproxy::port,
  40. 6080)
  41. $vncproxy_path_real = pick(
  42. $vncproxy_path,
  43. $::nova::compute::vncproxy_path,
  44. $::nova::vncproxy::vncproxy_path,
  45. '/vnc_auto.html')
  46. if ($vncproxy_host_real) {
  47. $vncproxy_base_url = "${vncproxy_protocol_real}://${vncproxy_host_real}:${vncproxy_port_real}${vncproxy_path_real}"
  48. # config for vnc proxy
  49. nova_config {
  50. 'vnc/novncproxy_base_url': value => $vncproxy_base_url;
  51. }
  52. }
  53. }