From adcbe1687a8539fd5e0d71f99b1a3f5d77a0963a Mon Sep 17 00:00:00 2001 From: Alexander Trost Date: Sun, 18 Oct 2015 19:36:32 +0200 Subject: [PATCH] Moved the create user functions to an external script It's dumb to create an user when the system isn't up yet.. --- entrypoint.sh | 12 +----------- includes/zulip-puppet/files/createZulipUser.sh | 13 +++++++++++++ .../files/supervisor/conf.d/zulippostsetup.conf | 9 +++++++++ includes/zulip-puppet/manifests/voyager.pp | 15 +++++++++++++++ 4 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 includes/zulip-puppet/files/createZulipUser.sh create mode 100644 includes/zulip-puppet/files/supervisor/conf.d/zulippostsetup.conf diff --git a/entrypoint.sh b/entrypoint.sh index 95fc614..cad92ef 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,7 +7,7 @@ fi set -e ZULIP_CURRENT_DEPLOY="$ZULIP_DIR/deployments/current" -MANAGE_PY="$ZULIP_CURRENT_DEPLOY/manage.py" +export MANAGE_PY="$ZULIP_CURRENT_DEPLOY/manage.py" ZULIP_SETTINGS="/etc/zulip/settings.py" ZULIP_ZPROJECT_SETTINGS="$ZULIP_CURRENT_DEPLOY/zproject/settings.py" @@ -259,16 +259,6 @@ zulipCreateUser(){ echo "No zulip user full name given. Defaulting to \"Zulip Docker\"" export ZULIP_USER_FULLNAME="Zulip Docker" fi - su zulip -c "$MANAGE_PY create_user --this-user-has-accepted-the-tos \"$ZULIP_USER_EMAIL\" \"$ZULIP_USER_FULLNAME\" --domain \"$ZULIP_USER_DOMAIN\"" || : - su zulip -c "$MANAGE_PY knight \"$ZULIP_USER_EMAIL\" -f" - cat | expect < 644, source => "puppet:///modules/zulip/cron.d/restart-zulip", } + file { "/etc/supervisor/conf.d/zulippostsetup.conf": + require => Package[supervisor], + ensure => file, + owner => "root", + group => "root", + mode => 644, + source => "puppet:///modules/zulip/supervisor/conf.d/nginx.conf", + } + file { "/usr/local/bin/createZulipUser.sh": + ensure => file, + owner => "root", + group => "root", + mode => 644, + source => "puppet:///modules/zulip/createZulipUser.sh", + } }