Subramanya Sastry has uploaded a new change for review.

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

Change subject: Add parsoid::testing role and use it on ruthenium
......................................................................

Add parsoid::testing role and use it on ruthenium

* The repo is initialized via git and is installed in
  /usr/lib/parsoid to mimic the setup on ruthenium and
  could possibly be moved to /srv/parsoid later on.

Change-Id: I6e8405b296afe1970bc647076cbda02ee353054d
---
M manifests/role/parsoid.pp
M manifests/site.pp
2 files changed, 69 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/24/264024/1

diff --git a/manifests/role/parsoid.pp b/manifests/role/parsoid.pp
index b9dd1eb..75e9380 100644
--- a/manifests/role/parsoid.pp
+++ b/manifests/role/parsoid.pp
@@ -247,6 +247,71 @@
     include role::ci::slave::labs::common
     # Also need the slave scripts for multi-git.sh
     include contint::slave_scripts
+}
 
+# This role is used by testing services
+# Ex: Parsoid roundtrip testing, Parsoid & PHP parser visual diff testing
+class role::parsoid::testing {
+    system::role { 'role::parsoid::testing':
+        description => 'Parsoid server (rt-testing, visual-diffing, etc.)'
+    }
 
+    include role::parsoid::common
+
+    group { 'parsoid':
+        ensure => present,
+        name   => 'parsoid',
+        system => true,
+    }
+
+    user { 'parsoid':
+        gid        => 'parsoid',
+        home       => '/var/lib/parsoid',
+        managehome => true,
+        system     => true,
+    }
+
+    # We clone the git repo and let testing services
+    # update / modify the repo as appropriate
+    # (via scripts, manually, however).
+    git::clone { 'mediawiki/services/parsoid/deploy':
+        ensure    => latest,
+        owner     => 'root',
+        group     => 'wikidev',
+        # FIXME: Should we move this to /srv/parsoid ?
+        # I am picking /usr/lib to minimize changes to
+        # ruthenium setup.
+        directory => '/usr/lib/parsoid',
+    }
+
+    file { '/etc/init/parsoid.conf':
+        ensure => present,
+        owner  => root,
+        group  => root,
+        mode   => '0444',
+        source => 'puppet:///files/misc/parsoid.upstart',
+    }
+
+    file { '/var/log/parsoid':
+        ensure => directory,
+        owner  => parsoid,
+        group  => parsoid,
+        mode   => '0775',
+    }
+
+    $parsoid_log_file = '/var/log/parsoid/parsoid.log'
+    $parsoid_node_path = '/usr/lib/parsoid/deploy/node_modules'
+    # default local settings -- test setups provide their own settings
+    $parsoid_settings_file = '/usr/lib/parsoid/src/localsettings.js'
+    $parsoid_base_path = '/usr/lib/parsoid/deploy/src'
+
+    #TODO: Duplication of code, deduplicate somehow
+    file { '/etc/default/parsoid':
+        ensure  => present,
+        owner   => root,
+        group   => root,
+        mode    => '0444',
+        content => template('misc/parsoid.default.erb'),
+        require => File['/var/log/parsoid'],
+    }
 }
diff --git a/manifests/site.pp b/manifests/site.pp
index b74f13d..f23097d 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2338,7 +2338,10 @@
 # Right now, both rt-server and rt-clients run on the same node
 # But, we are likely going to split them into different boxes soon.
 node 'ruthenium.eqiad.wmnet' {
-    role testsystem, parsoid-rt-server, parsoid-rt-client
+    role testsystem,
+         parsoid::testing,
+         parsoid-rt-server,
+         parsoid-rt-client
 }
 
 # T95046 install/deploy scandium as zuul merger (ci) server

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

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

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

Reply via email to