puppet-glance/manifests/db/sync.pp
Yanis Guenane 48a7164021 Creation of glance::db::sync
In order to standardize the way dbsync are run across our modules,
we create a new class glance::db::sync.
This class will be included if sync_db is enabled.

By making this transition the glance::db::sync class
can be returned by the ENC.

A use case would be in an highly available environment, with 3 galera
nodes, include glance::registry on every node with sync_db set to false
and have the ENC return glance::db::sync just for one node.

Change-Id: I16c8bc411bd34f720513a5d4c94e82b07105af20
2015-09-08 10:46:21 +02:00

24 lines
627 B
Puppet

#
# Class to execute glance dbsync
#
class glance::db::sync {
include ::glance::params
Package<| tag == 'glance-package' |> ~> Exec['glance-manage db_sync']
Exec['glance-manage db_sync'] ~> Service<| tag == 'glance-service' |>
Glance_registry_config<||> ~> Exec['glance-manage db_sync']
Glance_api_config<||> ~> Exec['glance-manage db_sync']
Glance_cache_config<||> ~> Exec['glance-manage db_sync']
exec { 'glance-manage db_sync':
command => $::glance::params::db_sync_command,
path => '/usr/bin',
user => 'glance',
refreshonly => true,
logoutput => on_failure,
}
}