Added debconf screen to ask if dbsync should be done (Closes: #787536).
[openstack-build/ceilometer-build.git] / xenial / debian / ceilometer-common.postinst.in
index 8b26aa0aea6157c10a6fd2c3b6772703d9ea6990..f061e5ed2e3918f9e058772b7537dbb235b35dbd 100644 (file)
@@ -12,7 +12,7 @@ libvirt_user_group () {
                LIBVIRT_GROUP=libvirt
        fi
 
-       if ! getent group libvirt >/dev/null; then
+       if ! getent group ${LIBVIRT_GROUP} >/dev/null; then
                addgroup --system ${LIBVIRT_GROUP}
        fi
 
@@ -40,14 +40,14 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
        pkgos_var_user_group ceilometer
        libvirt_user_group
        adduser ceilometer nova || true
-       adduser ceilometer libvirt || true
+       adduser ceilometer ${LIBVIRT_GROUP} || true
        pkgos_write_new_conf ceilometer ceilometer.conf
-       pkgos_write_new_conf ceilometer policy.json
-       pkgos_write_new_conf ceilometer sources.json
-       pkgos_write_new_conf ceilometer pipeline.yaml
-       pkgos_rabbit_write_conf /etc/ceilometer/ceilometer.conf DEFAULT ceilometer
+       pkgos_rabbit_write_conf /etc/ceilometer/ceilometer.conf oslo_messaging_rabbit ceilometer
        pkgos_write_admin_creds /etc/ceilometer/ceilometer.conf keystone_authtoken ceilometer
-       ceilometer-dbsync || true
+       db_get ceilometer/configure_db
+       if [ "$RET" = "true" ]; then
+               ceilometer-dbsync || true
+       fi
 fi
 
 #DEBHELPER#