[MediaWiki-commits] [Gerrit] Setup Gerrit role account for Phabricator actions - change (operations/puppet)

2015-09-23 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: Setup Gerrit role account for Phabricator actions
..


Setup Gerrit role account for Phabricator actions

Change-Id: I7221c126a8a34fe9ddde495d84c52db0a8cde341
---
M manifests/role/phabricator.pp
M modules/phabricator/manifests/tools.pp
2 files changed, 15 insertions(+), 12 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/manifests/role/phabricator.pp b/manifests/role/phabricator.pp
index 9264da6..1217cbc 100644
--- a/manifests/role/phabricator.pp
+++ b/manifests/role/phabricator.pp
@@ -16,6 +16,7 @@
 include passwords::phabricator
 $phabtools_cert= $passwords::phabricator::phabtools_cert
 $phabtools_user= $passwords::phabricator::phabtools_user
+$gerritbot_token   = $passwords::phabricator::gerritbot_token
 }
 
 # production phabricator instance
@@ -75,18 +76,19 @@
 }
 
 class { '::phabricator::tools':
-dbhost => $mysql_host,
-manifest_user  => $role::phabricator::config::mysql_maniphestuser,
-manifest_pass  => $role::phabricator::config::mysql_maniphestpass,
-app_user   => $role::phabricator::config::mysql_appuser,
-app_pass   => $role::phabricator::config::mysql_apppass,
-bz_user=> $role::phabricator::config::bz_user,
-bz_pass=> $role::phabricator::config::bz_pass,
-rt_user=> $role::phabricator::config::rt_user,
-rt_pass=> $role::phabricator::config::rt_pass,
-phabtools_cert => $role::phabricator::config::phabtools_cert,
-phabtools_user => $role::phabricator::config::phabtools_user,
-dump   => true,
+dbhost  => $mysql_host,
+manifest_user   => $role::phabricator::config::mysql_maniphestuser,
+manifest_pass   => $role::phabricator::config::mysql_maniphestpass,
+app_user=> $role::phabricator::config::mysql_appuser,
+app_pass=> $role::phabricator::config::mysql_apppass,
+bz_user => $role::phabricator::config::bz_user,
+bz_pass => $role::phabricator::config::bz_pass,
+rt_user => $role::phabricator::config::rt_user,
+rt_pass => $role::phabricator::config::rt_pass,
+phabtools_cert  => $role::phabricator::config::phabtools_cert,
+phabtools_user  => $role::phabricator::config::phabtools_user,
+gerritbot_token => $role::phabricator::config::gerritbot_token,
+dump=> true,
 }
 
 cron { 'phab_dump':
diff --git a/modules/phabricator/manifests/tools.pp 
b/modules/phabricator/manifests/tools.pp
index 16c24bf..a531280 100644
--- a/modules/phabricator/manifests/tools.pp
+++ b/modules/phabricator/manifests/tools.pp
@@ -16,6 +16,7 @@
 $rt_pass   = '',
 $phabtools_cert= '',
 $phabtools_user= '',
+$gerritbot_token   = '',
 $dump  = false,
 ) {
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7221c126a8a34fe9ddde495d84c52db0a8cde341
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Chad 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Rush 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Setup Gerrit role account for Phabricator actions - change (operations/puppet)

2015-08-27 Thread Chad (Code Review)
Chad has uploaded a new change for review.

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

Change subject: Setup Gerrit role account for Phabricator actions
..

Setup Gerrit role account for Phabricator actions

Includes convenience class for writing standardized arcrc files
for scripts to use.

Change-Id: I7221c126a8a34fe9ddde495d84c52db0a8cde341
---
M manifests/role/phabricator.pp
A modules/phabricator/manifests/arcrc.pp
M modules/phabricator/manifests/tools.pp
A modules/phabricator/templates/ackrc.erb
4 files changed, 50 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/32/234332/1

diff --git a/manifests/role/phabricator.pp b/manifests/role/phabricator.pp
index 6d44c04..1e5331c 100644
--- a/manifests/role/phabricator.pp
+++ b/manifests/role/phabricator.pp
@@ -16,6 +16,8 @@
 include passwords::phabricator
 $phabtools_cert= $passwords::phabricator::phabtools_cert
 $phabtools_user= $passwords::phabricator::phabtools_user
+$gerritbot_cert= $passwords::phabricator::gerritbot_cert
+$gerritbot_user= $passwords::phabricator::gerritbot_user
 }
 
 # production phabricator instance
@@ -85,6 +87,8 @@
 rt_pass= $role::phabricator::config::rt_pass,
 phabtools_cert = $role::phabricator::config::phabtools_cert,
 phabtools_user = $role::phabricator::config::phabtools_user,
+gerritbot_cert = $role::phabricator::config::gerritbot_cert,
+gerritbot_user = $role::phabricator::config::gerritbot_user,
 dump   = true,
 }
 
diff --git a/modules/phabricator/manifests/arcrc.pp 
b/modules/phabricator/manifests/arcrc.pp
new file mode 100644
index 000..96e5b8b
--- /dev/null
+++ b/modules/phabricator/manifests/arcrc.pp
@@ -0,0 +1,27 @@
+# == Class: phabricator::arcrc
+#
+# === Parameters
+#
+# [*rootdir*]
+#Phabricator base directory
+# [*user*]
+#User who's arcrc file we're writing
+# [*cert*]
+#Their secret cert
+
+define phabricator::arcrc(
+   $rootdir = '/',
+   $user= '',
+   $cert= '',
+) {
+   file { ${rootdir}/arcrc:
+   ensure  = directory,
+   require = File[${rootdir}],
+   }
+
+file { ${rootdir}/arcrc/${user}.arcrc:
+ensure  = 'file',
+content = template('phabricator/arcrc.erb'),
+require = File[${rootdir}/arcrc],
+}
+}
diff --git a/modules/phabricator/manifests/tools.pp 
b/modules/phabricator/manifests/tools.pp
index 16c24bf..799321d 100644
--- a/modules/phabricator/manifests/tools.pp
+++ b/modules/phabricator/manifests/tools.pp
@@ -16,6 +16,8 @@
 $rt_pass   = '',
 $phabtools_cert= '',
 $phabtools_user= '',
+$gerritbot_cert= '',
+$gerritbot_user= '',
 $dump  = false,
 ) {
 
@@ -66,4 +68,10 @@
 hour= '1',
 require = Git::Install['phabricator/tools'],
 }
+
+phabricator::arcrc { gerritbot:
+rootdir = $::phabricator::phabdir,
+user= $gerrit_bot_user,
+cert= $gerrit_bot_cert,
+}
 }
diff --git a/modules/phabricator/templates/ackrc.erb 
b/modules/phabricator/templates/ackrc.erb
new file mode 100644
index 000..b9fa23b
--- /dev/null
+++ b/modules/phabricator/templates/ackrc.erb
@@ -0,0 +1,11 @@
+{
+  hosts  : {
+https:\/\/phabricator.wikimedia.org\/api\/ : {
+  user : %= @user %,
+  cert : %= @cert %
+}
+  },
+  config : {
+default : https:\/\/phabricator.wikimedia.org\/api\/
+  }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7221c126a8a34fe9ddde495d84c52db0a8cde341
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Chad ch...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits