X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=trusty%2Fdebian%2Fceilometer-common.postinst.in;h=623271b3d33ef4809480c44ac76e3497a34a7e11;hb=refs%2Fheads%2Fanonscm.debian.org%2Fdebian%2Fmitaka%2Ffor-trusty;hp=e4f3dafd60e30e88ac599ee4c1ea278c872176d2;hpb=d0ba5e1cb44a5a61f1f0a607eeed3ef336a57d9f;p=openstack-build%2Fceilometer-build.git diff --git a/trusty/debian/ceilometer-common.postinst.in b/trusty/debian/ceilometer-common.postinst.in index e4f3daf..623271b 100644 --- a/trusty/debian/ceilometer-common.postinst.in +++ b/trusty/debian/ceilometer-common.postinst.in @@ -6,13 +6,19 @@ set -e # 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 @@ -34,17 +40,22 @@ libvirt_user_group () { 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