File: placement-common.postinst.in

package info (click to toggle)
placement 14.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,380 kB
  • sloc: python: 17,629; sh: 310; makefile: 61; pascal: 30
file content (35 lines) | stat: -rwxr-xr-x 776 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

set -e

ETC=/etc/placement
CONF=${ETC}/placement.conf

#PKGOS-INCLUDE#

if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
	. /usr/share/debconf/confmodule
	. /usr/share/dbconfig-common/dpkg/postinst

	pkgos_var_user_group placement

	pkgos_write_new_conf placement placement.conf

	# Do the db creation using dbconfig-common
	db_get placement/configure_db
	if [ "$RET" = "true" ] ; then
		pkgos_dbc_postinst ${CONF} placement_database connection placement $@
		echo "Now doing placement-manage db sync: this may take a while..."
		su placement -s /bin/sh -c "placement-manage db sync"
	fi

	db_get placement/configure_ksat
	if [ "$RET" = "true" ] ; then
		pkgos_write_admin_creds ${CONF} keystone_authtoken placement
	fi
	db_stop
fi

#DEBHELPER#

exit 0