Clean up OpenStack references and genericize

To make this module more downstream-friendly, abstract out any
references to OpenStack and turn them into classvars.

Change-Id: Ie005d5629623a14f4ebd8aef21294f222249232f
This commit is contained in:
Jeremy Stanley 2016-08-24 18:11:27 +00:00
parent 0af7e6addd
commit ea9b6df992
2 changed files with 18 additions and 13 deletions

View File

@ -16,11 +16,14 @@ class mediawiki(
$wg_recaptchasecretkey = undef,
$wg_googleanalyticsaccount = undef,
$wg_dbserver = 'localhost',
$wg_dbname = 'openstack_wiki',
$wg_dbname = 'wikidb',
$wg_dbuser = 'wikiuser',
$wg_dbpassword = undef,
$wg_secretkey = undef,
$wg_upgradekey = undef,
$wg_sitename = undef,
$wg_logo = undef,
$wg_openidforcedprovider = 'https://login.launchpad.net/+openid',
) {
if ($role == 'app' or $role == 'all') {

View File

@ -2,7 +2,9 @@
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
$wgSitename = "OpenStack";
<% if @wg_sitename != nil %>
$wgSitename = "<%= @wg_sitename %>";
<% end %>
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
@ -14,15 +16,16 @@ $wgScriptExtension = ".php";
$wgArticlePath = '/wiki/$1';
## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://wiki.openstack.org";
$wgServer = "https://<%= @site_hostname %>";
## The relative URL path to the skins directory
$wgStylePath = "$wgScriptPath/skins";
## The relative URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
#$wgLogo = "https://wiki.openstack.org/w/images/4/4c/OpenStack.png";
$wgLogo = "https://wiki.openstack.org/w/images/thumb/c/c4/OpenStack_Logo_-_notext.png/30px-OpenStack_Logo_-_notext.png";
<% if @wg_logo != nil %>
## The relative URL path to the logo. Make sure you change this from the
## default, or else you'll overwrite your logo when you upgrade!
$wgLogo = "<%= @wg_logo %>";
<% end %>
## UPO means: this is also a user preference option
@ -30,8 +33,8 @@ $wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgRequirePasswordforEmailChange = false;
$wgEmergencyContact = "noc@openstack.org";
$wgPasswordSender = "noc@openstack.org";
$wgEmergencyContact = "<%= @serveradmin %>";
$wgPasswordSender = "<%= @serveradmin %>";
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
@ -215,10 +218,9 @@ $wgOpenIDTrustEmailAddress = true;
# e-mail address as the username if a nickname is not given by the OpenID
$wgOpenIDUseEmailAsNickname = true;
# Our servername
$wgTrustRoot = 'https://wiki.openstack.org/';
# Only allow login through launchpad (in earlier versions of the plugin,
# wgOpenIDConsumerForce was used instead of wgOpenIDForcedProvider)
$wgOpenIDForcedProvider = 'https://login.launchpad.net/+openid';
$wgTrustRoot = "https://<%= @site_hostname %>/";
# Only allow login through a specific OpenID provider
$wgOpenIDForcedProvider = "<%= @wg_openidforcedprovider %>";
$wgOpenIDAllowExistingAccountSelection = false;
$wgOpenIDAllowAutomaticUsername = false;