Rush has submitted this change and it was merged.
Change subject: manage phabricator extensions
......................................................................
manage phabricator extensions
Change-Id: I11ce182bd9a787072a5a1e6fec92bb9f2a4eb232
---
M manifests/role/phabricator.pp
M modules/phabricator/manifests/init.pp
2 files changed, 50 insertions(+), 5 deletions(-)
Approvals:
Rush: Looks good to me, approved
jenkins-bot: Verified
diff --git a/manifests/role/phabricator.pp b/manifests/role/phabricator.pp
index e962f35..f17be63 100644
--- a/manifests/role/phabricator.pp
+++ b/manifests/role/phabricator.pp
@@ -49,6 +49,9 @@
mysql_admin_user => $::mysql_adminuser,
mysql_admin_pass => $::mysql_adminpass,
auth_type => 'dual',
+ extension_tag => 'HEAD',
+ extensions => ['MediaWikiUserpageCustomField.php',
+ 'SecurityPolicyEnforcerAction.php'],
settings => {
'search.elastic.host' =>
'http://search.svc.eqiad.wmnet:9200',
'search.elastic.namespace' => 'phabricatormain',
@@ -117,10 +120,12 @@
$mysqlpass = 'labspass'
$current_tag = 'fabT552'
class { '::phabricator':
- git_tag => $current_tag,
- lock_file => '/var/run/phab_repo_lock',
- auth_type => 'local',
- settings => {
+ git_tag => $current_tag,
+ lock_file => '/var/run/phab_repo_lock',
+ auth_type => 'local',
+ extension_tag => 'HEAD',
+ extensions => ['SecurityPolicyEnforcerAction.php'],
+ settings => {
'search.elastic.host' => 'http://localhost:9200',
'search.elastic.namespace' => 'phabricator',
'darkconsole.enabled' => true,
@@ -151,7 +156,7 @@
}
package { 'elasticsearch':
- ensure => present,
+ ensure => present,
require => Package['openjdk-7-jre-headless'],
}
diff --git a/modules/phabricator/manifests/init.pp
b/modules/phabricator/manifests/init.pp
index 52101ff..25045ed 100644
--- a/modules/phabricator/manifests/init.pp
+++ b/modules/phabricator/manifests/init.pp
@@ -43,6 +43,12 @@
# [*auth_type*]
# Specify a template to match the provided login mechanisms
#
+# [*extension_tag*]
+# Track extension revision
+#
+# [*extensions*]
+# Array of extensions to load
+#
# === Examples
#
# class { 'phabricator':
@@ -61,6 +67,8 @@
$timezone = 'America/Los_Angeles',
$lock_file = '',
$git_tag = 'HEAD',
+ $extension_tag = '',
+ $extensions = [],
$settings = {},
$mysql_admin_user = '',
$mysql_admin_pass = '',
@@ -144,6 +152,31 @@
notify => Exec["ensure_lock_${lock_file}"],
}
+ if ($extension_tag) {
+
+ $ext_lock_path = "${phabdir}/extension_lock_${extension_tag}"
+
+ git::install { 'phabricator/extensions':
+ directory => "${phabdir}/extensions",
+ git_tag => $extension_tag,
+ lock_file => $ext_lock_path,
+ notify => Exec[$ext_lock_path],
+ before => Git::Install['phabricator/phabricator'],
+ }
+
+ exec {$ext_lock_path:
+ command => "touch ${ext_lock_path}",
+ unless => "test -z ${ext_lock_path} || test -e ${ext_lock_path}",
+ path => '/usr/bin:/bin',
+ }
+
+ phabricator::extension { $extensions:
+ rootdir => $phabdir,
+ require => Git::Install['phabricator/extensions'],
+ }
+
+ }
+
#we ensure lock exists if string is not null
exec {"ensure_lock_${lock_file}":
command => "touch ${lock_file}",
@@ -207,3 +240,10 @@
require => Git::Install['phabricator/phabricator'],
}
}
+
+define phabricator::extension($rootdir='/') {
+ file { "${rootdir}/phabricator/src/extensions/${name}":
+ ensure => link,
+ target => "${rootdir}/extensions/${name}",
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/158874
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I11ce182bd9a787072a5a1e6fec92bb9f2a4eb232
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Rush <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits