Commit 404fde3d authored by anarcat's avatar anarcat

first implementation of the frontend slave debian package

parent 97cf5a94
#! /bin/sh
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
if [ "$DPKG_DEBUG" = "developer" ]; then
set -x
fi
db_input high aegir/master_ssh_key || true
db_input high aegir/master_mountpoint || true
db_go
var/aegir
var/aegir/config
#!/bin/sh
# postinst script for provision
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
# Source debconf library.
. /usr/share/debconf/confmodule
if [ "$DPKG_DEBUG" = "developer" ]; then
set -x
fi
VARLIB="/var/aegir"
case "$1" in
configure)
# add a aegir user if one does not already exist
if ! getent passwd aegir >/dev/null ; then
echo "adding aegir user..."
adduser --quiet --system --no-create-home --group \
--home "$VARLIB" \
--shell '/bin/bash' \
--gecos 'Aegir user,,,' \
aegir
fi
adduser --quiet aegir www-data
if [ -d /etc/sudoers.d ]; then
ucf --debconf-ok /usr/share/doc/aegir-provision/examples/example.sudoers /etc/sudoers.d/aegir
ucfr aegir-provision /etc/sudoers.d/aegir
chmod 440 /etc/sudoers.d/aegir
else
echo "running an older version of sudo"
echo "copy content of /usr/share/doc/aegir-provision/examples/example.sudoers into /etc/sudoers for aegir to run properly"
fi
# fix permissions on installed directories
chown aegir:aegir "$VARLIB" "$VARLIB/config"
# make sure we have apache configs settled in, for remote headless aegir servers
touch $VARLIB/config/apache.conf
chown aegir:aegir "$VARLIB/config/apache.conf"
ln -sf $VARLIB/config/apache.conf /etc/apache2/conf.d/aegir.conf
a2enmod ssl rewrite
apache2ctl graceful
db_get "aegir/master_ssh_key"
SSH_KEY="$RET"
if ! grep -q "$SSH_KEY" $VARLIB/.ssh/authorized_keys; then
mkdir -p $VARLIB/.ssh
echo "$SSH_KEY" >> $VARLIB/.ssh/authorized_keys
chown aegir:aegir $VARLIB/.ssh $VARLIB/.ssh/authorized_keys
chmod 700 $VARLIB/.ssh
chmod 600 $VARLIB/.ssh/authorized_keys
fi
db_get "aegir/master_mountpoint"
MOUNT="$RET"
if grep -q "/var/aegir/platforms" /etc/fstab ; then
if ! grep -q "$MOUNT.*/var/aegir/platforms" /etc/fstab ; then
sed -i.dpkg-orig "/\\/var\\/aegir\\/platforms/s#^.*\$#$MOUNT /var/aegir/platforms nfs rw 0 0#" /etc/fstab
echo "installed new fstab, original kept in /etc/fstab.dpkg-orig"
fi
else
cp /etc/fstab /etc/fstab.dpkg-orig
echo "$MOUNT /var/aegir/platforms nfs rw 0 0" >> /etc/fstab
echo "installed new fstab, original kept in /etc/fstab.dpkg-orig"
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
Template:aegir/master_ssh_key
Type: string
Description: Public SSH key of the master server
This is the public SSH key of the Aegir user on the master server.
.
If this is changed, it will simply be *added* to the
/var/aegir/.ssh/authorized_keys file, the previous key will not be
removed.
Template:aegir/master_mountpoint
Type: string
Description: Mountpoint of the master server
Enter here the location of the remote filesystem the slave should
mount. This should look something like this:
.
master.example.com:/var/aegir/platforms
.
This will be mounted to /var/aegir/platforms.
.
Enter nothing if you do not want this package to meddle with your
/etc/fstab.
aegir-provision (1.6+webpack-1) testing; urgency=low
* special build for the dev-webpack1x branch
* add scripts to configure the slave server
-- Antoine Beaupré <anarcat@koumbit.org> Tue, 07 Feb 2012 17:55:01 -0500
aegir-provision (1.6-1) testing; urgency=low
* new upstream release
......
......@@ -60,3 +60,22 @@ Description: mass Drupal hosting system
.
This meta-package will install both the frontend (aegir-hostmaster)
and the backend (aegir-provision).
Package: aegir-cluster-slave
Architecture: all
Depends: ${misc:Depends}, php5-mysql, sudo, apache2, adduser, ucf, libapache2-mod-php5, rsync, nfs-client
Recommends: php5-gd, php5
Description: web frontend for the Aegir hosting system
Configuration of lightweight slave servers for the Aegir "pack"
clustering system.
.
This is meant to be installed on remote servers that are "slave
servers" in the "pack" cluster. This package will configure the
following parts of your system, through debconf prompts:
.
* create a aegir user
* /etc/fstab - to NFS-mount the master server
* /var/aegir/.ssh/authorized_keys - to allow the master server to
connect via SSH to sync files and reload apache
* /etc/sudoers.d/aegir - allow aegir to restart apache
* /etc/apache2/conf.d/aegir.conf - load the aegir apache config
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment