sync_api.pp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #
  2. # Class to execute nova api_db sync
  3. #
  4. # ==Parameters
  5. #
  6. # [*extra_params*]
  7. # (optional) String of extra command line parameters to append
  8. # to the nova-manage db sync command. These will be inserted in
  9. # the command line between 'nova-manage' and 'db sync'.
  10. # Defaults to undef
  11. #
  12. # [*cellv2_setup*]
  13. # (optional) This flag toggles if we preform a minimal cell_v2 setup of a
  14. # a single cell.
  15. # NOTE: 'nova-manage cell_v2 discover_hosts' must be
  16. # run after any nova-compute hosts have been deployed.
  17. # This flag will be set to true in Ocata when the cell v2 setup is mandatory.
  18. # Defaults to false.
  19. #
  20. # [*db_sync_timeout*]
  21. # (optional) Timeout for the execution of the db_sync
  22. # Defaults to 300.
  23. #
  24. class nova::db::sync_api(
  25. $extra_params = undef,
  26. $cellv2_setup = false,
  27. $db_sync_timeout = 300,
  28. ) {
  29. include ::nova::deps
  30. include ::nova::params
  31. exec { 'nova-db-sync-api':
  32. command => "/usr/bin/nova-manage ${extra_params} api_db sync",
  33. refreshonly => true,
  34. try_sleep => 5,
  35. tries => 10,
  36. timeout => $db_sync_timeout,
  37. logoutput => on_failure,
  38. subscribe => [
  39. Anchor['nova::install::end'],
  40. Anchor['nova::config::end'],
  41. Anchor['nova::db::end'],
  42. Anchor['nova::dbsync_api::begin']
  43. ],
  44. notify => Anchor['nova::dbsync_api::end'],
  45. }
  46. if $cellv2_setup {
  47. include ::nova::cell_v2::simple_setup
  48. }
  49. }