From 992463503e844fe40f3bb2a56df5db0cb715942e Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Wed, 17 Jan 2018 10:12:28 -0500 Subject: python-neutron: uprev to latest stable/pike Following along with other recent openstack component uprevs the configuration has been changed to match the installation/setup configuration documented by the openstack community. We have also made the switch to using systemd. The initial configuration file (neutron.conf) was generated by getting things mostly updated and running, then copying/cloning the source repo on the target and running the setup scripts (see ./tools/generate_config_file_samples.sh) With these updates neutron is running and available but is yet to be fully tested, this must be done once we have a running compute node and guests. Required updates/uprevs/introduction to: python-ryu, python-neutron-lib, python-os-xenapi, python-oslo.privsep, python-ovs, python-weakrefmethod, and more Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- .../python/python-neutron/neutron-init | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-neutron/neutron-init (limited to 'meta-openstack/recipes-devtools/python/python-neutron/neutron-init') diff --git a/meta-openstack/recipes-devtools/python/python-neutron/neutron-init b/meta-openstack/recipes-devtools/python/python-neutron/neutron-init new file mode 100644 index 0000000..fe98dcb --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-neutron/neutron-init @@ -0,0 +1,51 @@ +#!/bin/bash +# +# Basic neutron setup based on: +# https://docs.openstack.org/neutron/pike/install/controller-install-ubuntu.html +# +# Prerequisites: keystone must be available and bootstrapped +# + +# Substitutions setup at do_intall() +DB_USER=%DB_USER% +NEUTRON_USER=%NEUTRON_USER% +NEUTRON_GROUP=%NEUTRON_GROUP% +CONTROLLER_IP=%CONTROLLER_IP% +ADMIN_USER=%ADMIN_USER% +ADMIN_PASSWORD=%ADMIN_PASSWORD% +ADMIN_ROLE=%ADMIN_ROLE% +SYSCONFDIR=%SYSCONFDIR% +ROOT_HOME=%ROOT_HOME% + +# Create the neutron DB and grant the necessary permissions +sudo -u postgres psql -c "CREATE DATABASE neutron" 2> /dev/null +sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE neutron TO ${DB_USER}" 2> /dev/null + +source ${SYSCONFDIR}/keystone/admin-openrc + +openstack user create --domain default --password ${ADMIN_PASSWORD} ${NEUTRON_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 ${NEUTRON_USER} ${ADMIN_ROLE} + +openstack service create --name neutron --description "OpenStack Networking" network +openstack endpoint create --region RegionOne network public http://${CONTROLLER_IP}:9696 +openstack endpoint create --region RegionOne network internal http://${CONTROLLER_IP}:9696 +openstack endpoint create --region RegionOne network admin http://${CONTROLLER_IP}:9696 + +sudo -u ${NEUTRON_USER} neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head + +# Possibly move to rabbitmq-setup, for now we are the only service +# that needs this so do it here. +HOME=${ROOT_HOME} rabbitmqctl add_user openstack ${ADMIN_PASSWORD} +HOME=${ROOT_HOME} rabbitmqctl set_permissions openstack ".*" ".*" ".*" + +#systemctl restart nova-api +systemctl restart neutron-server +systemctl restart neutron-linuxbridge-agent +systemctl restart neutron-dhcp-agent +systemctl restart neutron-metadata-agent -- cgit v1.2.3-54-g00ecf