mysql_api.pp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # == Class: nova::db::mysql_api
  2. #
  3. # Class that configures mysql for the nova_api database.
  4. #
  5. # === Parameters:
  6. #
  7. # [*password*]
  8. # Password to use for the nova user
  9. #
  10. # [*dbname*]
  11. # (optional) The name of the database
  12. # Defaults to 'nova_api'
  13. #
  14. # [*user*]
  15. # (optional) The mysql user to create
  16. # Defaults to 'nova_api'
  17. #
  18. # [*host*]
  19. # (optional) The IP address of the mysql server
  20. # Defaults to '127.0.0.1'
  21. #
  22. # [*charset*]
  23. # (optional) The charset to use for the nova database
  24. # Defaults to 'utf8'
  25. #
  26. # [*collate*]
  27. # (optional) The collate to use for the nova database
  28. # Defaults to 'utf8_general_ci'
  29. #
  30. # [*allowed_hosts*]
  31. # (optional) Additional hosts that are allowed to access this DB
  32. # Defaults to undef
  33. #
  34. # === DEPRECATED
  35. #
  36. # TODO(aschultz): we can just remove this after tripleo gets fixed to use
  37. # the new param
  38. # [*setup_cell0*]
  39. # (optional) Setup a cell0 for the cell_v2 functionality. This option will
  40. # be set to true by default in Ocata when the cell v2 setup is mandatory.
  41. # Defaults to undef
  42. #
  43. class nova::db::mysql_api(
  44. $password,
  45. $dbname = 'nova_api',
  46. $user = 'nova_api',
  47. $host = '127.0.0.1',
  48. $charset = 'utf8',
  49. $collate = 'utf8_general_ci',
  50. $allowed_hosts = undef,
  51. # DEPREACTED
  52. $setup_cell0 = undef
  53. ) {
  54. if $setup_cell0 {
  55. warning('nova::db::mysql_api::setup_cell0 is deprecated, use nova::db::mysql::setup_cell0 instead. This will be removed in Pike')
  56. }
  57. include ::nova::deps
  58. ::openstacklib::db::mysql { 'nova_api':
  59. user => $user,
  60. password_hash => mysql_password($password),
  61. dbname => $dbname,
  62. host => $host,
  63. charset => $charset,
  64. collate => $collate,
  65. allowed_hosts => $allowed_hosts,
  66. }
  67. Anchor['nova::db::begin']
  68. ~> Class['nova::db::mysql_api']
  69. ~> Anchor['nova::db::end']
  70. }