auth.pp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. # == Class: nova::keystone::auth
  2. #
  3. # Creates nova endpoints and service account in keystone
  4. #
  5. # === Parameters:
  6. #
  7. # [*password*]
  8. # Password to create for the service user
  9. #
  10. # [*auth_name*]
  11. # (optional) The name of the nova service user
  12. # Defaults to 'nova'
  13. #
  14. # [*service_name*]
  15. # (optional) Name of the service.
  16. # Defaults to 'nova'.
  17. #
  18. # [*service_description*]
  19. # (optional) Description for keystone service.
  20. # Defaults to 'Openstack Compute Service'.
  21. #
  22. # [*public_url*]
  23. # (optional) The endpoint's public url.
  24. # Defaults to 'http://127.0.0.1:8774/v2.1'
  25. #
  26. # [*internal_url*]
  27. # (optional) The endpoint's internal url.
  28. # Defaults to 'http://127.0.0.1:8774/v2.1'
  29. #
  30. # [*admin_url*]
  31. # (optional) The endpoint's admin url.
  32. # Defaults to 'http://127.0.0.1:8774/v2.1'
  33. #
  34. # [*region*]
  35. # (optional) The region in which to place the endpoints
  36. # Defaults to 'RegionOne'
  37. #
  38. # [*tenant*]
  39. # (optional) The tenant to use for the nova service user
  40. # Defaults to 'services'
  41. #
  42. # [*email*]
  43. # (optional) The email address for the nova service user
  44. # Defaults to 'nova@localhost'
  45. #
  46. # [*configure_endpoint*]
  47. # (optional) Whether to create the endpoint.
  48. # Defaults to true
  49. #
  50. # [*configure_user*]
  51. # (optional) Whether to create the service user.
  52. # Defaults to true
  53. #
  54. # [*configure_user_role*]
  55. # (optional) Whether to configure the admin role for the service user.
  56. # Defaults to true
  57. #
  58. # DEPRECATED PARAMETERS
  59. #
  60. # [*public_url_v3*]
  61. # (optional) Deprecated. The v3 endpoint's public url.
  62. # Defaults to undef.
  63. #
  64. # [*internal_url_v3*]
  65. # (optional) Deprecated. The v3 endpoint's internal url.
  66. # Defaults to undef.
  67. #
  68. # [*admin_url_v3*]
  69. # (optional) DEPRECATED The v3 endpoint's admin url.
  70. # Defaults to undef.
  71. #
  72. # [*service_description_v3*]
  73. # (optional) Deprecated. Description for keystone v3 service.
  74. # Defaults to undef.
  75. #
  76. # [*service_name_v3*]
  77. # (optional) Deprecated. Name of the v3 service.
  78. # Defaults to undef.
  79. #
  80. # [*auth_name_v3*]
  81. # (optional) Deprecated. The name of the nova v3 service user
  82. # Defaults to undef.
  83. #
  84. # [*configure_endpoint_v3*]
  85. # (optional) Deprecated. Whether to create the v3 endpoint.
  86. # Defaults to undef.
  87. #
  88. class nova::keystone::auth(
  89. $password,
  90. $auth_name = 'nova',
  91. $service_name = 'nova',
  92. $service_description = 'Openstack Compute Service',
  93. $region = 'RegionOne',
  94. $tenant = 'services',
  95. $email = 'nova@localhost',
  96. $public_url = 'http://127.0.0.1:8774/v2.1',
  97. $internal_url = 'http://127.0.0.1:8774/v2.1',
  98. $admin_url = 'http://127.0.0.1:8774/v2.1',
  99. $configure_endpoint = true,
  100. $configure_user = true,
  101. $configure_user_role = true,
  102. # DEPRECATED PARAMETERS
  103. $auth_name_v3 = undef,
  104. $service_description_v3 = undef,
  105. $service_name_v3 = undef,
  106. $public_url_v3 = undef,
  107. $internal_url_v3 = undef,
  108. $admin_url_v3 = undef,
  109. $configure_endpoint_v3 = undef,
  110. ) {
  111. include ::nova::deps
  112. if $auth_name_v3 or $service_description_v3 or $service_name_v3 or
  113. $public_url_v3 or $internal_url_v3 or $admin_url_v3 or $configure_endpoint_v3 {
  114. warning("all parameters related to v3 API in nova::keystone::auth are \
  115. deprecated, have no effect and will be removed after Newton release.")
  116. }
  117. if $configure_endpoint {
  118. Keystone_endpoint["${region}/${service_name}::compute"] ~> Service <| name == 'nova-api' |>
  119. }
  120. keystone::resource::service_identity { 'nova':
  121. configure_user => $configure_user,
  122. configure_user_role => $configure_user_role,
  123. configure_endpoint => $configure_endpoint,
  124. service_type => 'compute',
  125. service_description => $service_description,
  126. service_name => $service_name,
  127. region => $region,
  128. auth_name => $auth_name,
  129. password => $password,
  130. email => $email,
  131. tenant => $tenant,
  132. public_url => $public_url,
  133. admin_url => $admin_url,
  134. internal_url => $internal_url,
  135. }
  136. }