[Devstack] Add stack user to libvirt group

Ironic is needed to have libvirtd perms to manage VMs. When nova is
enabled all needed perms are granted in nova devstack plugin.
This patch ensures that stack user is added to libvirt group when nova
is not enabled.

Change-Id: If65002d775c9ff001f5a8e27ed1f6af1f8b4cf40
This commit is contained in:
Vasyl Saienko 2017-01-30 09:24:05 +02:00
parent 7dff244a3b
commit d602bb53b0

View File

@ -912,6 +912,19 @@ function configure_ironic {
if [[ "$IRONIC_IPXE_ENABLED" == "True" ]]; then
_config_ironic_apache_wsgi
fi
# NOTE(vsaienko) Add stack to libvirt group when installing without nova.
if ! is_service_enabled nova; then
if [[ "$os_VENDOR" =~ (Debian) ]]; then
LIBVIRT_GROUP=libvirt
else
LIBVIRT_GROUP=libvirtd
fi
if ! getent group $LIBVIRT_GROUP >/dev/null; then
sudo groupadd $LIBVIRT_GROUP
fi
add_user_to_group $STACK_USER $LIBVIRT_GROUP
fi
}
# configure_ironic_api() - Is used by configure_ironic(). Performs