summaryrefslogtreecommitdiff
path: root/openstack-ironic.configure
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2015-03-25 11:32:22 +0000
committerTiago Gomes <tiago.gomes@codethink.co.uk>2015-03-25 11:32:22 +0000
commit7044fcd5cbadab3aa8e4d5c054bad471901f2981 (patch)
tree97d77c2e4feb906821f9be5c40e40353fd4922cd /openstack-ironic.configure
parenta0e5891f84c168165b059cca3ab0943a39dc34eb (diff)
downloaddefinitions-baserock/tiagogomes/openstack-v4/ironic.tar.gz
Diffstat (limited to 'openstack-ironic.configure')
-rw-r--r--openstack-ironic.configure57
1 files changed, 57 insertions, 0 deletions
diff --git a/openstack-ironic.configure b/openstack-ironic.configure
new file mode 100644
index 00000000..ed400660
--- /dev/null
+++ b/openstack-ironic.configure
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Copyright (C) 2014-2015 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
+
+ROOT="$1"
+
+##########################################################################
+# Substitutions in configuration files #
+##########################################################################
+
+cat <<EOF > "$ROOT"/etc/openstack-ironic-setup.sed
+s/##IRONIC_SERVICE_USER##/$IRONIC_SERVICE_USER/g
+s/##IRONIC_SERVICE_PASSWORD##/$IRONIC_SERVICE_PASSWORD/g
+s/##IRONIC_DB_USER##/$IRONIC_DB_USER/g
+s/##IRONIC_DB_PASSWORD##/$IRONIC_DB_PASSWORD/g
+s/##IRONIC_PUBLIC_URL##/$IRONIC_PUBLIC_URL/g
+s/##IRONIC_INTERNAL_URL##/$IRONIC_INTERNAL_URL/g
+s/##IRONIC_ADMIN_URL##/$IRONIC_ADMIN_URL/g
+s/##GLANCE_HOST##/$GLANCE_HOST/g
+s/##OPENSTACK_AUTH_HOST##/$OPENSTACK_AUTH_HOST/g
+s/##OPENSTACK_AUTH_PORT##/$OPENSTACK_AUTH_PORT/g
+s/##RABBITMQ_HOST##/$RABBITMQ_HOST/g
+s/##IDENTITY_URI##/$IDENTITY_URI/g
+
+EOF
+
+sed -f "$ROOT"/etc/openstack-ironic-setup.sed -i \
+ "$ROOT"/etc/ironic/ironic.conf \
+ "$ROOT"/usr/share/openstack/openstack-ironic-setup
+
+##########################################################################
+# Create the links to enable the ironic systemd services #
+##########################################################################
+
+services=("openstack-ironic-setup.service" \
+ "openstack-ironic-api.service" \
+ "openstack-ironic-conductor.service")
+
+for service in ${services[@]}; do
+ ln -sf "/etc/systemd/system/$service" \
+ "$ROOT/etc/systemd/system/multi-user.target.wants/$service"
+done