postgresql_api.pp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # == Class: nova::db::postgresql_api
  2. #
  3. # Class that configures postgresql for the nova_api database.
  4. # Requires the Puppetlabs postgresql module.
  5. #
  6. # === Parameters
  7. #
  8. # [*password*]
  9. # (Required) Password to connect to the database.
  10. #
  11. # [*dbname*]
  12. # (Optional) Name of the database.
  13. # Defaults to 'nova_api'.
  14. #
  15. # [*user*]
  16. # (Optional) User to connect to the database.
  17. # Defaults to 'nova_api'.
  18. #
  19. # [*encoding*]
  20. # (Optional) The charset to use for the database.
  21. # Default to undef.
  22. #
  23. # [*privileges*]
  24. # (Optional) Privileges given to the database user.
  25. # Default to 'ALL'
  26. #
  27. class nova::db::postgresql_api(
  28. $password,
  29. $dbname = 'nova_api',
  30. $user = 'nova_api',
  31. $encoding = undef,
  32. $privileges = 'ALL',
  33. ) {
  34. include ::nova::deps
  35. ::openstacklib::db::postgresql { 'nova_api':
  36. password_hash => postgresql_password($user, $password),
  37. dbname => $dbname,
  38. user => $user,
  39. encoding => $encoding,
  40. privileges => $privileges,
  41. }
  42. Anchor['nova::db::begin']
  43. ~> Class['nova::db::postgresql_api']
  44. ~> Anchor['nova::db::end']
  45. }