Dzahn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/148564

Change subject: phab - configurable login message by auth type
......................................................................

phab - configurable login message by auth type

depending on the type of login a phabricator instance
allows to be used for auth (SUL account, LDAP account,
both, maybe others in the future..), change which
template is being used for the HTML of the login screen

Change-Id: Iae4ab606563579973ad3731d0ebcf39d665634f9
---
M manifests/role/phabricator.pp
M modules/phabricator/manifests/init.pp
R modules/phabricator/templates/auth_log_message_dual.erb
3 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/64/148564/1

diff --git a/manifests/role/phabricator.pp b/manifests/role/phabricator.pp
index 134a076..9f3f548 100644
--- a/manifests/role/phabricator.pp
+++ b/manifests/role/phabricator.pp
@@ -16,6 +16,7 @@
         lock_file        => '/var/run/phab_repo_lock',
         mysql_admin_user => $::mysql_adminuser,
         mysql_admin_pass => $::mysql_adminpass,
+        auth_type        => 'sul',
         settings         => {
             'darkconsole.enabled'                => true,
             'phabricator.base-uri'               => 
'https://legalpad.wikimedia.org',
@@ -47,6 +48,7 @@
         lock_file => '/var/run/phab_repo_lock',
         mysql_admin_user => $::mysql_adminuser,
         mysql_admin_pass => $::mysql_adminpass,
+        auth_type => 'dual',
         settings  => {
             'storage.upload-size-limit'              => '10M',
             'darkconsole.enabled'                    => false,
@@ -90,6 +92,7 @@
     class { '::phabricator':
         git_tag   => $current_tag,
         lock_file => '/var/run/phab_repo_lock',
+        auth_type => 'dual',
         settings  => {
             'darkconsole.enabled'                => true,
             'phabricator.base-uri'               => 
"http://${::hostname}.wmflabs.org";,
diff --git a/modules/phabricator/manifests/init.pp 
b/modules/phabricator/manifests/init.pp
index d1813e9..c3b2967 100644
--- a/modules/phabricator/manifests/init.pp
+++ b/modules/phabricator/manifests/init.pp
@@ -62,6 +62,7 @@
     $mysql_admin_user = '',
     $mysql_admin_pass = '',
     $serveradmin      = '',
+    $auth_type        = '',
 ) {
 
     #A combination of static and dynamic conf parameters must be merged
@@ -71,7 +72,15 @@
     #per stdlib merge the dynamic settings will take precendence for conflicts
     $phab_settings = merge($fixed_settings, $settings)
 
-    $phab_settings['auth.login-message'] = 
template('phabricator/auth_log_message.erb')
+    # depending on what type of auth we use (SUL,LDAP,both,others) we change
+    # which template we use for the login message
+    case $auth_type {
+        'sul':  { $auth_template = "auth_log_message_sul.erb" }
+        'dual': { $auth_template = "auth_log_message_dual.erb" }
+        default: { fail ('please set an auth type for the login message') }
+    }
+
+    $phab_settings['auth.login-message'] = template($auth_template)
 
     if empty(mysql_admin_user) {
         $storage_user = $phab_settings['mysql.user']
diff --git a/modules/phabricator/templates/auth_log_message.erb 
b/modules/phabricator/templates/auth_log_message_dual.erb
similarity index 100%
rename from modules/phabricator/templates/auth_log_message.erb
rename to modules/phabricator/templates/auth_log_message_dual.erb

-- 
To view, visit https://gerrit.wikimedia.org/r/148564
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae4ab606563579973ad3731d0ebcf39d665634f9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to