#!/bin/sh set -e if [ "$1" = "configure" ]; then # Create the "puppet" user if ! getent passwd puppet > /dev/null; then adduser --quiet --system --group --home /var/lib/puppet \ --no-create-home \ --gecos "Puppet configuration management daemon" \ puppet fi # Create the "puppet" group, if it is missing, and set the # primary group of the "puppet" user to this group. if ! getent group puppet > /dev/null; then addgroup --quiet --system puppet usermod -g puppet puppet fi # Set correct permissions and ownership for puppet directories if ! dpkg-statoverride --list /var/log/puppet >/dev/null 2>&1; then dpkg-statoverride --update --add puppet puppet 0750 /var/log/puppet fi if ! dpkg-statoverride --list /var/lib/puppet >/dev/null 2>&1; then dpkg-statoverride --update --add puppet puppet 0750 /var/lib/puppet fi # Create folders common to "puppet" and "puppetmaster", which need # to be owned by the "puppet" user install --owner puppet --group puppet --directory \ /var/lib/puppet/state # Handle if [ -d /etc/puppet/ssl ] && [ ! -e /var/lib/puppet/ssl ] && grep -q 'ssldir=/var/lib/puppet/ssl' /etc/puppet/puppet.conf; then mv /etc/puppet/ssl /var/lib/puppet/ssl fi fi #DEBHELPER#