X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=trusty%2Fdebian%2Fceilometer-common.postinst.in;h=623271b3d33ef4809480c44ac76e3497a34a7e11;hb=07e067df4658bcc2f5a1e5a1ce1955dc120b47a7;hp=757725f13c2bfb92d2a5349ba6281cebf143cd7f;hpb=20c9e506db5515125d8962ce68825b1e15ae20c2;p=openstack-build%2Fceilometer-build.git diff --git a/trusty/debian/ceilometer-common.postinst.in b/trusty/debian/ceilometer-common.postinst.in index 757725f..623271b 100644 --- a/trusty/debian/ceilometer-common.postinst.in +++ b/trusty/debian/ceilometer-common.postinst.in @@ -6,8 +6,20 @@ set -e # We need to do that for ceilometer-agent-compute libvirt_user_group () { - if ! getent group libvirt >/dev/null; then - addgroup --system libvirt + if getent group libvirt ; then + LIBVIRT_GROUP=libvirt + elif getent group libvirtd ; then + LIBVIRT_GROUP=libvirtd + else + if dpkg-vendor --derives-from ubuntu ; then + LIBVIRT_GROUP=libvirtd + else + LIBVIRT_GROUP=libvirt + fi + fi + + if ! getent group ${LIBVIRT_GROUP} >/dev/null; then + addgroup --system ${LIBVIRT_GROUP} fi # user and group libvirt runs qemu/kvm instances with @@ -28,16 +40,22 @@ libvirt_user_group () { fi } -if [ "$1" = "configure" ]; then - pkgos_var_user_group nova +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 - 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