File: manila-common.postinst.in

package info (click to toggle)
manila 1%3A3.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,272 kB
  • ctags: 16,488
  • sloc: python: 149,825; sh: 1,898; pascal: 73; makefile: 58
file content (44 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
#!/bin/sh

set -e

CONF=/etc/manila/manila.conf

#PKGOS-INCLUDE#

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

	pkgos_var_user_group manila

	# We need that extra folder.
	mkdir -p /var/lib/manila/volumes
	chown -R manila:manila /var/lib/manila/volumes

	# Install config files.
	pkgos_write_new_conf manila manila.conf
	pkgos_write_new_conf manila api-paste.ini
	pkgos_write_new_conf manila logging.conf
	pkgos_write_new_conf manila policy.json
	pkgos_write_new_conf manila rootwrap.conf
	chown root:root /etc/manila/rootwrap.conf
	if ! [ -e /etc/manila/rootwrap.d ] ; then
		cp -auxf /usr/share/manila-common/rootwrap.d /etc/manila
		chown -R root:root /etc/manila/rootwrap.d
		chmod 0755 /etc/manila/rootwrap.d
	fi

	pkgos_rabbit_write_conf ${CONF} oslo_messaging_rabbit manila
	pkgos_write_admin_creds ${CONF} keystone_authtoken manila

	db_get manila/configure_db
	if [ "$RET" = "true" ]; then
		pkgos_dbc_postinst ${CONF} database connection manila $@
		su -s /bin/sh -c 'manila-manage db sync' manila
	fi
fi

#DEBHELPER#

exit 0