Skip to content

Commit

Permalink
This should fix the problems with the automatic user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
galexrt committed Oct 19, 2015
1 parent b617f0f commit cd75ef7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
12 changes: 12 additions & 0 deletions includes/zulip-puppet/files/setupZulipUser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

/home/zulip/deployments/current/manage.py create_user --this-user-has-accepted-the-tos "$ZULIP_USER_EMAIL" "$ZULIP_USER_FULLNAME" --domain "$ZULIP_USER_DOMAIN" || :
/home/zulip/deployments/current/manage.py knight "$ZULIP_USER_EMAIL" -f || :
/home/zulip/deployments/current/manage.py shell <<EOF
from zerver.decorator import get_user_profile_by_email
User = get_user_profile_by_email('atrost@zerbytes.net')
User.set_password('$ZULIP_USER_PASSWORD')
User.save()
EOF
rm -rf /etc/supervisor/conf.d/zulip_postsetup.conf
exit 0
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[program:zulip-postsetup]
command = bash -c "/usr/local/bin/zulipCreateUser.sh"
[program:zulip-postsetup-create_user]
command = bash -c "sleep 8;/opt/setupZulipUser.sh"
user=zulip
stdout_events_enabled=true
stderr_events_enabled=true
autorestart = false
16 changes: 0 additions & 16 deletions includes/zulip-puppet/files/zulipCreateUser.sh

This file was deleted.

4 changes: 2 additions & 2 deletions includes/zulip-puppet/manifests/voyager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
mode => 644,
source => "puppet:///modules/zulip/supervisor/conf.d/zulip_postsetup.conf",
}
file { "/usr/local/bin/zulipPostSetup.sh":
file { "/opt/setupZulipUser.sh":
ensure => file,
owner => "root",
group => "root",
mode => 755,
source => "puppet:///modules/zulip/zulipPostSetup.sh",
source => "puppet:///modules/zulip/setupZulipUser.sh",
}
}

0 comments on commit cd75ef7

Please sign in to comment.