| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
ETC=/etc/cyborg |
| 6 |
CONF=${ETC}/cyborg.conf |
| 7 |
|
| 8 |
#PKGOS-INCLUDE# |
| 9 |
|
| 10 |
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then |
| 11 |
. /usr/share/debconf/confmodule |
| 12 |
. /usr/share/dbconfig-common/dpkg/postinst |
| 13 |
|
| 14 |
pkgos_var_user_group cyborg |
| 15 |
|
| 16 |
# Make sure we have a /etc/cyborg folder with config files in it. |
| 17 |
pkgos_write_new_conf cyborg cyborg.conf |
| 18 |
pkgos_write_new_conf cyborg api-paste.ini |
| 19 |
|
| 20 |
pkgos_rabbit_write_conf ${CONF} oslo_messaging_rabbit cyborg |
| 21 |
pkgos_write_admin_creds ${CONF} keystone_authtoken cyborg |
| 22 |
|
| 23 |
# Do the db creation using dbconfig-common |
| 24 |
db_get cyborg/configure_db |
| 25 |
if [ "$RET" = "true" ] ; then |
| 26 |
pkgos_dbc_postinst ${CONF} database connection cyborg $@ |
| 27 |
echo "Now doing cyborg-dbsync: this may take a while..." |
| 28 |
su -s /bin/sh -c "cyborg-dbsync --config-file /etc/cyborg/cyborg.conf upgrade" cyborg || true |
| 29 |
fi |
| 30 |
|
| 31 |
db_stop |
| 32 |
fi |
| 33 |
|
| 34 |
#DEBHELPER# |
| 35 |
|
| 36 |
exit 0 |