48a7164021
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
45 lines
1.0 KiB
Ruby
45 lines
1.0 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'glance::db::sync' do
|
|
|
|
shared_examples_for 'glance-dbsync' do
|
|
|
|
it 'runs glance-manage db_sync' do
|
|
is_expected.to contain_exec('glance-manage db_sync').with(
|
|
:command => 'glance-manage --config-file=/etc/glance/glance-registry.conf db_sync',
|
|
:path => '/usr/bin',
|
|
:user => 'glance',
|
|
:refreshonly => 'true',
|
|
:logoutput => 'on_failure'
|
|
)
|
|
end
|
|
|
|
end
|
|
|
|
context 'on a RedHat osfamily' do
|
|
let :facts do
|
|
{
|
|
:osfamily => 'RedHat',
|
|
:operatingsystemrelease => '7.0',
|
|
:concat_basedir => '/var/lib/puppet/concat'
|
|
}
|
|
end
|
|
|
|
it_configures 'glance-dbsync'
|
|
end
|
|
|
|
context 'on a Debian osfamily' do
|
|
let :facts do
|
|
{
|
|
:operatingsystemrelease => '7.8',
|
|
:operatingsystem => 'Debian',
|
|
:osfamily => 'Debian',
|
|
:concat_basedir => '/var/lib/puppet/concat'
|
|
}
|
|
end
|
|
|
|
it_configures 'glance-dbsync'
|
|
end
|
|
|
|
end
|