summaryrefslogtreecommitdiff
path: root/openstack/usr/share/openstack
diff options
context:
space:
mode:
Diffstat (limited to 'openstack/usr/share/openstack')
-rw-r--r--openstack/usr/share/openstack/openstack-glance-setup57
-rw-r--r--openstack/usr/share/openstack/openstack-keystone-setup56
-rw-r--r--openstack/usr/share/openstack/openstack-nova-compute-setup56
-rw-r--r--openstack/usr/share/openstack/openstack-nova-setup64
4 files changed, 233 insertions, 0 deletions
diff --git a/openstack/usr/share/openstack/openstack-glance-setup b/openstack/usr/share/openstack/openstack-glance-setup
new file mode 100644
index 00000000..63b73422
--- /dev/null
+++ b/openstack/usr/share/openstack/openstack-glance-setup
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Copyright (C) 2014 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+# Create required system users and groups
+getent group glance >/dev/null || groupadd -r --gid 164 glance
+getent passwd glance >/dev/null || \
+ useradd --uid 164 -r -g glance -d /var/lib/glance -s /sbin/nologin \
+ -c "OpenStack Glance Daemons" glance
+
+# Create required keystone tenants, users and roles
+export OS_SERVICE_TOKEN=##KEYSTONE_TEMPORARY_ADMIN_TOKEN##
+export OS_SERVICE_ENDPOINT='http://localhost:35357/v2.0'
+
+keystone user-create --name ##GLANCE_SERVICE_USER## --pass ##GLANCE_SERVICE_PASSWORD##
+keystone user-role-add --tenant service --user ##GLANCE_SERVICE_USER## --role admin
+
+keystone service-create --name glance --type image --description "OpenStack Image Service"
+keystone endpoint-create --service-id $(keystone service-list | awk '/ image / {print $2}') \
+ --publicurl ##GLANCE_PUBLIC_URL## \
+ --internalurl ##GLANCE_INTERNAL_URL## \
+ --adminurl ##GLANCE_ADMIN_URL##
+
+# Setup the glance database
+if [ ! -e /var/lib/glance/glance.sqlite ]; then
+ chown glance:glance /var/lib/glance
+ chown glance:glance /var/log/glance
+ sudo -u glance glance-manage db_sync
+fi
+
+rm /etc/systemd/system/multi-user.target.wants/openstack-glance-setup.service
+
+systemctl start openstack-glance-api
+systemctl start openstack-glance-registry
+
+ln -s "/etc/systemd/system/openstack-glance-api.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-glance-api.service"
+
+ln -s "/etc/systemd/system/openstack-glance-registry.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-glance-registry.service"
+
+exit 0
diff --git a/openstack/usr/share/openstack/openstack-keystone-setup b/openstack/usr/share/openstack/openstack-keystone-setup
new file mode 100644
index 00000000..9dc204d4
--- /dev/null
+++ b/openstack/usr/share/openstack/openstack-keystone-setup
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# Copyright (C) 2014 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+# Create required system users and groups
+
+getent group keystone >/dev/null || groupadd -r --gid 163 keystone
+getent passwd keystone >/dev/null || \
+ useradd --uid 163 -r -g keystone -d /var/lib/keystone -s /sbin/nologin \
+ -c "OpenStack Keystone Daemons" keystone
+
+# Setup the keystone database
+
+if [ ! -e /var/lib/keystone/keystone.sqlite ]; then
+ chown keystone:keystone /var/lib/keystone
+ sudo -u keystone keystone-manage db_sync
+fi
+
+systemctl start openstack-keystone
+
+export OS_SERVICE_TOKEN=##KEYSTONE_TEMPORARY_ADMIN_TOKEN##
+export OS_SERVICE_ENDPOINT='http://localhost:35357/v2.0'
+
+# This script creates a TEMPORARY admin user, with a password that may
+# float arount on the system. Please delete this user once you have set up
+# the real admin user with a real secure password.
+
+keystone tenant-create --name admin --description "Admin Tenant"
+keystone role-create --name admin
+
+keystone user-create --name temporary_admin --pass ##KEYSTONE_TEMPORARY_ADMIN_PASSWORD##
+keystone user-role-add --tenant admin --user temporary_admin --role admin
+
+keystone tenant-create --name service --description "Service Tenant"
+
+rm /etc/systemd/system/multi-user.target.wants/openstack-keystone-setup.service
+
+ln -s "/etc/systemd/system/openstack-keystone.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-keystone.service"
+
+exit 0
diff --git a/openstack/usr/share/openstack/openstack-nova-compute-setup b/openstack/usr/share/openstack/openstack-nova-compute-setup
new file mode 100644
index 00000000..9dc204d4
--- /dev/null
+++ b/openstack/usr/share/openstack/openstack-nova-compute-setup
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# Copyright (C) 2014 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+# Create required system users and groups
+
+getent group keystone >/dev/null || groupadd -r --gid 163 keystone
+getent passwd keystone >/dev/null || \
+ useradd --uid 163 -r -g keystone -d /var/lib/keystone -s /sbin/nologin \
+ -c "OpenStack Keystone Daemons" keystone
+
+# Setup the keystone database
+
+if [ ! -e /var/lib/keystone/keystone.sqlite ]; then
+ chown keystone:keystone /var/lib/keystone
+ sudo -u keystone keystone-manage db_sync
+fi
+
+systemctl start openstack-keystone
+
+export OS_SERVICE_TOKEN=##KEYSTONE_TEMPORARY_ADMIN_TOKEN##
+export OS_SERVICE_ENDPOINT='http://localhost:35357/v2.0'
+
+# This script creates a TEMPORARY admin user, with a password that may
+# float arount on the system. Please delete this user once you have set up
+# the real admin user with a real secure password.
+
+keystone tenant-create --name admin --description "Admin Tenant"
+keystone role-create --name admin
+
+keystone user-create --name temporary_admin --pass ##KEYSTONE_TEMPORARY_ADMIN_PASSWORD##
+keystone user-role-add --tenant admin --user temporary_admin --role admin
+
+keystone tenant-create --name service --description "Service Tenant"
+
+rm /etc/systemd/system/multi-user.target.wants/openstack-keystone-setup.service
+
+ln -s "/etc/systemd/system/openstack-keystone.service" \
+ "/etc/systemd/system/multi-user.target.wants/openstack-keystone.service"
+
+exit 0
diff --git a/openstack/usr/share/openstack/openstack-nova-setup b/openstack/usr/share/openstack/openstack-nova-setup
new file mode 100644
index 00000000..adb45ed8
--- /dev/null
+++ b/openstack/usr/share/openstack/openstack-nova-setup
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Copyright (C) 2014 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+set -e
+
+# Create required system users and groups
+
+getent group nova >/dev/null || groupadd -r --gid 165 nova
+getent passwd nova >/dev/null || \
+ useradd --uid 165 -r -g nova -d /var/lib/nova -s /sbin/nologin \
+ -c "OpenStack Keystone Daemons" nova
+
+# Create the keystone user and services
+
+export OS_SERVICE_TOKEN=##KEYSTONE_TEMPORARY_ADMIN_TOKEN##
+export OS_SERVICE_ENDPOINT='http://localhost:35357/v2.0'
+
+keystone user-create --name ##NOVA_SERVICE_USER## --pass ##NOVA_SERVICE_PASSWORD##
+keystone user-role-add --tenant service --user ##NOVA_SERVICE_USER## --role admin
+
+keystone service-create --name nova --type compute --description "OpenStack Image Service"
+keystone endpoint-create --service-id $(keystone service-list | awk '/ compute / {print $2}') \
+ --publicurl ##NOVA_PUBLIC_URL## \
+ --internalurl ##NOVA_INTERNAL_URL## \
+ --adminurl ##NOVA_ADMIN_URL## \
+ --region ##NOVA_REGION##
+
+# Setup the nova database
+
+if [ ! -e /var/lib/nova/nova.sqlite ]; then
+ chown nova:nova /var/lib/nova
+ sudo -u nova nova-manage db_sync
+fi
+
+#systemctl start openstack-nova-api
+#systemctl start openstack-nova-cert
+#systemctl start openstack-nova-consoleauth
+#systemctl start openstack-nova-scheduler
+#systemctl start openstack-nova-conductor
+#systemctl start openstack-nova-novncproxy
+
+# TODO, need to start more nova services.
+
+#ln -s "/etc/systemd/system/openstack-nova-api.service" \
+# "/etc/systemd/system/multi-user.target.wants/openstack-nova-api.service"
+
+#ln -s "/etc/systemd/system/openstack-nova-cert.service" \
+# "/etc/systemd/system/multi-user.target.wants/openstack-nova-cert.service"
+
+exit 0