20after4 has uploaded a new change for review.

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

Change subject: Add conduit_token to the .arcrc on nodepool slaves
......................................................................

Add conduit_token to the .arcrc on nodepool slaves

This is needed so that nodepool slaves can talk to phabricator.

This adds a call to secret('contint/conduit_token') so the
conduit token will need to be added to puppet/private by someone
from #operations. Any phabricator admin can generate a new token
for the jenkins user account by clicking '+ Generate API Token' on
the management page which is located at the following URL:

https://phabricator.wikimedia.org/settings/user/jenkins/page/apitokens/

Change-Id: I462af553caa36fa1552d64253fe5a80d8fae9369
---
D modules/contint/files/arcrc.json
M modules/contint/manifests/arcanist.pp
A modules/contint/templates/arcrc.json.erb
3 files changed, 15 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/97/298097/1

diff --git a/modules/contint/files/arcrc.json b/modules/contint/files/arcrc.json
deleted file mode 100644
index 0b8ad2c..0000000
--- a/modules/contint/files/arcrc.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "config": {
-      "default": "https://phabricator.wikimedia.org/";
-    }
-}
diff --git a/modules/contint/manifests/arcanist.pp 
b/modules/contint/manifests/arcanist.pp
index 8ead13c..4f4664f 100644
--- a/modules/contint/manifests/arcanist.pp
+++ b/modules/contint/manifests/arcanist.pp
@@ -3,12 +3,14 @@
 class contint::arcanist {
     require_package('arcanist')
 
-    file { '/var/lib/jenkins/.arcrc':
+    $conduit_token = secret('contint/conduit_token')
+
+    file { '/home/jenkins/.arcrc':
         ensure  => 'file',
         owner   => 'jenkins',
         group   => 'jenkins',
         mode    => '0600',
         require => User['jenkins'],
-        source  => 'puppet:///modules/contint/arcrc.json',
+        content => template('contint/arcrc.json.erb'),
     }
 }
diff --git a/modules/contint/templates/arcrc.json.erb 
b/modules/contint/templates/arcrc.json.erb
new file mode 100644
index 0000000..42246cd
--- /dev/null
+++ b/modules/contint/templates/arcrc.json.erb
@@ -0,0 +1,11 @@
+{
+  "config": {
+    "default": "https://phabricator.wikimedia.org/";
+  },
+  "hosts": {
+    "https://phabricator.wikimedia.org/api/": {
+      "user": "jenkins"
+      "token": "<%= @conduit_token%>",
+    }
+  }
+}

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

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

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

Reply via email to