Alexandros Kosiaris has submitted this change and it was merged.

Change subject: WIP: Phase 2 of switching to the new Parsoid deploy system
......................................................................


WIP: Phase 2 of switching to the new Parsoid deploy system

Follow-up to Iad299f0e43f309409a98d3f32d1ac9a3851228c3.

- forcfully kill nodejs

- remove custom deploy script that is no longer needed

- switch to upstart by default and remove references to init file and old repo

Change-Id: I2b3cc40ef2ede8d0212d4039d240c214e4a30866
---
M files/misc/parsoid.upstart
M manifests/role/parsoid.pp
D modules/deployment/files/modules/parsoid.py
3 files changed, 12 insertions(+), 40 deletions(-)

Approvals:
  Alexandros Kosiaris: Looks good to me, approved
  GWicke: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/files/misc/parsoid.upstart b/files/misc/parsoid.upstart
index a1aded7..cdd43ce 100644
--- a/files/misc/parsoid.upstart
+++ b/files/misc/parsoid.upstart
@@ -28,6 +28,11 @@
 respawn
 
 script
+    # kill any init-based instances for init -> upstart transition
+    if [ -x "/etc/init.d/parsoid" ] ; then
+        /etc/init.d/parsoid stop
+    fi
+
     if [ -f "$DEFAULTFILE" ] ; then
         . "$DEFAULTFILE"
     fi
diff --git a/manifests/role/parsoid.pp b/manifests/role/parsoid.pp
index 576ebcb..6a54265 100644
--- a/manifests/role/parsoid.pp
+++ b/manifests/role/parsoid.pp
@@ -65,9 +65,8 @@
     # upstart config prep, will replace sysv init above
     # Use name that does not match the 'parsoid' service name for now to avoid
     # it taking precedence over the init script
-    # TODO: remove init script and rename back to parsoid.conf
-    file { '/etc/init/parsoid-test.conf':
-        ensure  => absent,
+    file { '/etc/init/parsoid.conf':
+        ensure  => present,
         owner   => root,
         group   => root,
         mode    => '0444',
@@ -108,7 +107,11 @@
         hasstatus  => true,
         hasrestart => true,
         enable     => true,
-        require    => File['/etc/init.d/parsoid'],
+        provider   => 'upstart',
+        subscribe  => [
+            File['/etc/default/parsoid'],
+            File['/etc/init/parsoid.conf'],
+        ],
     }
 
     monitor_service { 'parsoid':
diff --git a/modules/deployment/files/modules/parsoid.py 
b/modules/deployment/files/modules/parsoid.py
deleted file mode 100644
index ce1d68e..0000000
--- a/modules/deployment/files/modules/parsoid.py
+++ /dev/null
@@ -1,36 +0,0 @@
-'''
-Parsoid deployment module for git-deploy / salt
-'''
-
-import os
-import subprocess
-
-
-def config_symlink(repo):
-    '''
-    Put a localsettings.js symlink in the Parsoid checkout pointing to the
-    config checkout
-    '''
-    config = __salt__['deploy.get_config'](repo)
-    lsSymlinkPath = config['location'] + '/js/api/localsettings.js'
-    nmSymlinkPath = config['location'] + '/js/node_modules'
-    if not __salt__['file.file_exists'](lsSymlinkPath):
-        try:
-            os.symlink('../../../config/localsettings.js', lsSymlinkPath)
-        except OSError:
-            return 1
-    if not __salt__['file.file_exists'](nmSymlinkPath):
-        try:
-            os.symlink('../../config/node_modules', nmSymlinkPath)
-        except OSError:
-            return 1
-
-    return 0
-
-
-def restart_parsoid(repo):
-    '''
-    restart the parsoid service
-    '''
-    ret = subprocess.call("/etc/init.d/parsoid restart", shell=True)
-    return ret

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2b3cc40ef2ede8d0212d4039d240c214e4a30866
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: GWicke <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to