# We need to do that for ceilometer-agent-compute
libvirt_user_group () {
- if dpkg-vendor --derives-from ubuntu ; then
+ if getent group libvirt ; then
+ LIBVIRT_GROUP=libvirt
+ elif getent group libvirtd ; then
LIBVIRT_GROUP=libvirtd
else
- LIBVIRT_GROUP=libvirt
+ if dpkg-vendor --derives-from ubuntu ; then
+ LIBVIRT_GROUP=libvirtd
+ else
+ LIBVIRT_GROUP=libvirt
+ fi
fi
- if ! getent group libvirt >/dev/null; then
+ if ! getent group ${LIBVIRT_GROUP} >/dev/null; then
addgroup --system ${LIBVIRT_GROUP}
fi
fi
}
-if [ "$1" = "configure" ]; then
+if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
+ . /usr/share/debconf/confmodule
pkgos_adduser nova
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
- ceilometer-dbsync || true
+ pkgos_rabbit_write_conf /etc/ceilometer/ceilometer.conf oslo_messaging_rabbit ceilometer
+ pkgos_write_admin_creds /etc/ceilometer/ceilometer.conf keystone_authtoken ceilometer
+ db_get ceilometer/configure_db
+ if [ "$RET" = "true" ]; then
+ ceilometer-dbsync || true
+ fi
fi
#DEBHELPER#
+
+exit 0