availability_zone.pp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # == Class: nova::availability_zone
  2. #
  3. # nova availability zone configuration
  4. #
  5. # === Parameters:
  6. #
  7. # [*default_availability_zone*]
  8. # (optional) Default compute node availability zone.
  9. # Defaults to $::os_service_default
  10. #
  11. # [*default_schedule_zone*]
  12. # (optional) Availability zone to use when user doesn't specify one.
  13. # Defaults to $::os_service_default
  14. #
  15. # [*internal_service_availability_zone*]
  16. # (optional) The availability zone to show internal services under.
  17. # Defaults to $::os_service_default
  18. #
  19. class nova::availability_zone (
  20. $default_availability_zone = $::os_service_default,
  21. $default_schedule_zone = $::os_service_default,
  22. $internal_service_availability_zone = $::os_service_default,
  23. ) {
  24. # NOTE(dalees): In order to keep backward compatibility from nova::compute we
  25. # rely on the pick function.
  26. $default_availability_zone_real = pick(
  27. $::nova::compute::default_availability_zone,
  28. $default_availability_zone)
  29. $default_schedule_zone_real = pick(
  30. $::nova::compute::default_schedule_zone,
  31. $default_schedule_zone)
  32. $internal_service_availability_zone_real = pick(
  33. $::nova::compute::internal_service_availability_zone,
  34. $internal_service_availability_zone)
  35. nova_config {
  36. 'DEFAULT/default_availability_zone': value => $default_availability_zone_real;
  37. 'DEFAULT/default_schedule_zone': value => $default_schedule_zone_real;
  38. 'DEFAULT/internal_service_availability_zone': value => $internal_service_availability_zone_real;
  39. }
  40. }