From 38973e8bc393a4ca36090c58c8b6eb6d093ea69a Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Fri, 1 Dec 2017 15:19:42 -0500 Subject: python-glance: uprev to latest stable/pike Complete the uprev and the transition to systemd. The configuration is cleaned up to match the setup documentation found in the openstack installation guide. Once a build is completed with these changes the controller image is able to have images added via: %> . /etc/keystone/admin-openrc %> openstack image create "cirros" \ --file cirros-0.3.5-x86_64-disk.img \ --disk-format qcow2 --container-format bare \ --public Images can be listed with 'openstack image list' or 'glance image-list' or via the horizon web interface. Requires introduction of python-glance-store... Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- .../python/python-glance/glance-init | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-glance/glance-init (limited to 'meta-openstack/recipes-devtools/python/python-glance/glance-init') diff --git a/meta-openstack/recipes-devtools/python/python-glance/glance-init b/meta-openstack/recipes-devtools/python/python-glance/glance-init new file mode 100644 index 0000000..8551399 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-glance/glance-init @@ -0,0 +1,42 @@ +#!/bin/bash +# +# Basic glance setup based on: +# https://docs.openstack.org/glance/pike/install/install-debian.html +# +# Prerequisites: keystone must be available and bootstrapped +# + +# Substitutions setup at do_intall() +DB_USER=%DB_USER% +GLANCE_USER=%GLANCE_USER% +GLANCE_GROUP=%GLANCE_GROUP% +CONTROLLER_IP=%CONTROLLER_IP% +ADMIN_USER=%ADMIN_USER% +ADMIN_PASSWORD=%ADMIN_PASSWORD% +ADMIN_ROLE=%ADMIN_ROLE% +SYSCONFDIR=%SYSCONFDIR% + +# Create the glance DB and grant the necessary permissions +sudo -u postgres psql -c "CREATE DATABASE glance" 2> /dev/null +sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE glance TO ${DB_USER}" 2> /dev/null + +source ${SYSCONFDIR}/keystone/admin-openrc + +openstack user create --domain default --password ${ADMIN_PASSWORD} ${GLANCE_USER} + +# Ensure the 'service' project exists +openstack project show service > /dev/null 2>&1 +if [ $? -ne 0 ]; then + openstack project create service --domain default +fi +openstack role add --project service --user ${GLANCE_USER} ${ADMIN_ROLE} + +openstack service create --name glance --description "OpenStack Image" image +openstack endpoint create --region RegionOne image public http://${CONTROLLER_IP}:9292 +openstack endpoint create --region RegionOne image internal http://${CONTROLLER_IP}:9292 +openstack endpoint create --region RegionOne image admin http://${CONTROLLER_IP}:9292 + +sudo -u ${GLANCE_USER} glance-manage db_sync + +systemctl restart glance-registry +systemctl restart glance-api -- cgit v1.2.3-54-g00ecf