File: openstack-cluster-installer.postinst.in

package info (click to toggle)
openstack-cluster-installer 21
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,212 kB
  • sloc: php: 9,235; sh: 2,936; makefile: 14
file content (57 lines) | stat: -rw-r--r-- 1,757 bytes parent folder | download | duplicates (5)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh

set -e

CONF=/etc/openstack-cluster-installer/openstack-cluster-installer.conf

#PKGOS-INCLUDE#

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

	pkgos_var_user_group oci

	chmod 0440 /etc/sudoers.d/oci

	install -g www-data -o www-data -m 0750 -d /etc/openstack-cluster-installer
	if [ ! -e ${CONF} ] ; then
		install -D -m 0640 -o www-data -g root /usr/share/openstack-cluster-installer/openstack-cluster-installer.conf ${CONF}
	else
		chown root:www-data ${CONF}
		chmod 0640 ${CONF}
	fi
	install -g www-data -o www-data -m 0750 -d /etc/openstack-cluster-installer/hiera
	install -g www-data -o www-data -m 0750 -d /etc/openstack-cluster-installer/hiera/roles
	install -g www-data -o www-data -m 0750 -d /etc/openstack-cluster-installer/hiera/nodes
	touch /etc/openstack-cluster-installer/hiera/all.yaml
	chown www-data:www-data /etc/openstack-cluster-installer/hiera/all.yaml

	# Install the web interface
	A2EN=$(which a2ensite)
	if [ -x "${A2EN}" ] ; then
		${A2EN} openstack-cluster-installer.conf
	fi

	# This is where we store node files when doing provisioning.
	mkdir -p /var/lib/oci/clusters
	chown www-data:www-data /var/lib/oci/clusters

	chown www-data:www-data /var/lib/oci
	mkdir -p /var/lib/oci/ssl
	chown www-data:www-data /var/lib/oci/ssl

	# Setup the db's password
	db_get openstack-cluster-installer/configure_db
	if [ "$RET" = "true" ]; then
		pkgos_dbc_postinst --suite oci ${CONF} database connection openstack-cluster-installer $@
		sed -i "s#connection = #connection=#" ${CONF}
		cd /usr/share/openstack-cluster-installer && php db_sync.php
	fi
	db_stop
	chgrp www-data /etc/openstack-cluster-installer
fi

#DEBHELPER#

exit 0