common.pp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # == Class: nova::ironic::common
  2. #
  3. # [*api_endpoint*]
  4. # The url for Ironic api endpoint.
  5. # Defaults to 'http://127.0.0.1:6385/v1'
  6. #
  7. # [*auth_plugin*]
  8. # The authentication plugin to use when connecting to nova.
  9. # Defaults to 'password'
  10. #
  11. # [*auth_url*]
  12. # The address of the Keystone api endpoint.
  13. # Defaults to 'http://127.0.0.1:35357/'
  14. #
  15. # [*project_name*]
  16. # The Ironic Keystone project name.
  17. # Defaults to 'services'
  18. #
  19. # [*password*]
  20. # The admin password for Ironic to connect to Nova.
  21. # Defaults to 'ironic'
  22. #
  23. # [*username*]
  24. # The admin username for Ironic to connect to Nova.
  25. # Defaults to 'admin'
  26. #
  27. # [*api_max_retries*]
  28. # Max times for ironic driver to poll ironic api
  29. #
  30. # [*api_retry_interval*]
  31. # Interval in second for ironic driver to poll ironic api
  32. #
  33. # === DEPRECATED
  34. #
  35. # [*admin_username*]
  36. # The admin username for Ironic to connect to Nova.
  37. # Defaults to 'admin'
  38. #
  39. # [*admin_password*]
  40. # The admin password for Ironic to connect to Nova.
  41. # Defaults to 'ironic'
  42. #
  43. # [*admin_url*]
  44. # The address of the Keystone api endpoint.
  45. # Defaults to 'http://127.0.0.1:35357/v2.0'
  46. #
  47. # [*admin_tenant_name*]
  48. # The Ironic Keystone tenant name.
  49. # Defaults to 'services'
  50. #
  51. class nova::ironic::common (
  52. $api_endpoint = 'http://127.0.0.1:6385/v1',
  53. $auth_plugin = 'password',
  54. $auth_url = 'http://127.0.0.1:35357/',
  55. $password = 'ironic',
  56. $project_name = 'services',
  57. $username = 'admin',
  58. $api_max_retries = $::os_service_default,
  59. $api_retry_interval = $::os_service_default,
  60. # DEPRECATED
  61. $admin_username = undef,
  62. $admin_password = undef,
  63. $admin_tenant_name = undef,
  64. $admin_url = undef,
  65. ) {
  66. include ::nova::deps
  67. if ($admin_username) {
  68. warning('nova::ironic::common::admin_username is deprecated. Please use username')
  69. }
  70. if ($admin_password) {
  71. warning('nova::ironic::common::admin_password is deprecated. Please use password')
  72. }
  73. if ($admin_tenant_name) {
  74. warning('nova::ironic::common::admin_tenant_name is deprecated. Please use project_name')
  75. }
  76. if ($admin_url) {
  77. warning('nova::ironic::common::admin_url is deprecated. Please use auth_url')
  78. }
  79. $username_real = pick($admin_username, $username)
  80. $password_real = pick($admin_password, $password)
  81. $auth_url_real = pick($admin_url, $auth_url)
  82. $project_name_real = pick($admin_tenant_name, $project_name)
  83. nova_config {
  84. 'ironic/auth_plugin': value => $auth_plugin;
  85. 'ironic/username': value => $username_real;
  86. 'ironic/password': value => $password_real;
  87. 'ironic/auth_url': value => $auth_url_real;
  88. 'ironic/project_name': value => $project_name_real;
  89. 'ironic/api_endpoint': value => $api_endpoint;
  90. 'ironic/api_max_retries': value => $api_max_retries;
  91. 'ironic/api_retry_interval': value => $api_retry_interval;
  92. }
  93. # TODO(aschultz): these are deprecated, remove in P
  94. nova_config {
  95. 'ironic/admin_username': value => $username_real;
  96. 'ironic/admin_password': value => $password_real;
  97. 'ironic/admin_url': value => $auth_url_real;
  98. 'ironic/admin_tenant_name': value => $project_name_real;
  99. }
  100. }