Re-run gnocchi and ceilometer upgrade in step 5

Without this gnocchi resources types are not created
as they are skipped initially and the resources from
ceilometer wont make it to gnocchi.

Closes-bug: #1674421

Depends-On: I753f37e121b95813e345f200ad3f3e75ec4bd7e1

Change-Id: Ib45bf1b3e526a58f675d7555fe7bb5038dadeede
This commit is contained in:
Pradeep Kilambi 2017-03-20 11:44:53 -04:00
parent 1deb6fea53
commit aec471a78d
4 changed files with 48 additions and 0 deletions

View File

@ -85,4 +85,12 @@ class tripleo::profile::base::ceilometer::collector (
include ::ceilometer::dispatcher::gnocchi
}
# Re-run ceilometer-upgrade again in step 5 so gnocchi resource types
# are created safely.
if $step >= 5 and $sync_db {
exec {'ceilometer-db-upgrade':
command => 'ceilometer-upgrade --skip-metering-database',
path => ['/usr/bin', '/usr/sbin'],
}
}
}

View File

@ -100,4 +100,13 @@ class tripleo::profile::base::gnocchi::api (
default: { fail('Unrecognized gnocchi_backend parameter.') }
}
}
# Re-run gnochci upgrade with storage as swift/ceph should be up at this
# stage.
if $step >= 5 and $sync_db {
exec {'run gnocchi upgrade with storage':
command => 'gnocchi-upgrade --config-file=/etc/gnocchi/gnocchi.conf',
path => ['/usr/bin', '/usr/sbin'],
}
}
}

View File

@ -0,0 +1,5 @@
---
fixes:
- Re-run gnocchi and ceilometer upgrade in step5. This is required
for gnocchi resource types to be created in ceilometer and gnocchi
to function properly.

View File

@ -128,6 +128,32 @@ describe 'tripleo::profile::base::ceilometer::collector' do
is_expected.to contain_class('ceilometer::dispatcher::gnocchi')
end
end
context 'with step 5 on bootstrap node' do
let(:params) { {
:step => 5,
:bootstrap_node => 'node.example.com',
:mongodb_node_ips => ['127.0.0.1',],
:mongodb_replset => 'replicaset'
} }
it 'should trigger complete configuration' do
is_expected.to contain_exec('ceilometer-db-upgrade')
end
end
context 'with step 5 not on bootstrap node' do
let(:params) { {
:step => 5,
:bootstrap_node => 'somethingelse.example.com',
:mongodb_node_ips => ['127.0.0.1',],
:mongodb_replset => 'replicaset'
} }
it 'should trigger complete configuration' do
is_expected.to_not contain_exec('ceilometer-db-upgrade')
end
end
end