From 5c9f72f96db3cf4b4e84c97707cf1feca8fcd53e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Charlier?= Date: Tue, 11 Dec 2012 18:14:37 +0100 Subject: [PATCH] Add the dbsync file, it's not yet in the packages --- files/dbsync | 27 +++++++++++++++++++++++++++ manifests/db.pp | 11 ++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 files/dbsync diff --git a/files/dbsync b/files/dbsync new file mode 100644 index 0000000..0769e45 --- /dev/null +++ b/files/dbsync @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- +# +# Author: John Tran +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +"""Run SQLAlchemy db migration. +""" + +import sys +from ceilometer import storage +from ceilometer.storage import migration +from ceilometer.openstack.common import cfg + +if __name__ == '__main__': + cfg.CONF(sys.argv[1:]) + migration.db_sync() diff --git a/manifests/db.pp b/manifests/db.pp index 7e94f8e..a8f26f0 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -42,7 +42,16 @@ class ceilometer::db ( Ceilometer_config['DEFAULT/database_connection'] ~> Exec['ceilometer-dbsync'] - exec{ 'ceilometer-dbsync': + file { '/usr/bin/ceilometer-dbsync': + ensure => present, + source => 'puppet:///modules/ceilometer/dbsync', + owner => 'root', + group => 'root', + mode => '0755', + before => Exec['ceilometer-dbsync'] + } + + exec { 'ceilometer-dbsync': command => $::ceilometer::params::dbsync_command, user => $::ceilometer::params::username, refreshonly => true, -- 2.45.2