Dzahn has uploaded a new change for review.

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

Change subject: ocg: make it work on systemd
......................................................................

ocg: make it work on systemd

Bug:T84723
Change-Id: I065b4ba42ed84a15d0545ff5af3eabd0016ef5a8
---
M modules/ocg/manifests/init.pp
1 file changed, 31 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/12/288112/1

diff --git a/modules/ocg/manifests/init.pp b/modules/ocg/manifests/init.pp
index 58b9d7a..8e416ff 100644
--- a/modules/ocg/manifests/init.pp
+++ b/modules/ocg/manifests/init.pp
@@ -83,13 +83,42 @@
         before => Service['ocg']
     }
 
+    if $::initsystem == 'systemd' {
+        $ocg_provider = 'systemd'
+        $ocg_require = '/etc/systemd/system/ocg.service'
+
+        file { '/etc/systemd/system/ocg.service':
+            ensure  => present,
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0444',
+            source  => 'puppet:///modules/ocg/ocg.service',
+            require => Package['ocg/ocg'],
+            notify  => Service['ocg'],
+        }
+
+    } else {
+        $ocg_provider = 'upstart'
+        $ocg_require = '/etc/init.ocg.conf'
+
+        file { '/etc/init/ocg.conf':
+            ensure  => present,
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0444',
+            content => template('ocg/ocg.upstart.conf.erb'),
+            require => User['ocg'],
+            notify  => Service['ocg'],
+        }
+    }
+
     service { 'ocg':
         ensure     => running,
-        provider   => upstart,
+        provider   => $ocg_provider,
         hasstatus  => false,
         hasrestart => false,
         require    => [
-            File['/etc/init/ocg.conf'],
+            File[$ocg_require],
             Package['ocg/ocg'],
         ],
     }
@@ -104,16 +133,6 @@
         group   => 'ocg',
         mode    => '0440',
         content => template('ocg/mw-ocg-service.js.erb'),
-        notify  => Service['ocg'],
-    }
-
-    file { '/etc/init/ocg.conf':
-        ensure  => present,
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0444',
-        content => template('ocg/ocg.upstart.conf.erb'),
-        require => User['ocg'],
         notify  => Service['ocg'],
     }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I065b4ba42ed84a15d0545ff5af3eabd0016ef5a8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <dz...@wikimedia.org>

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

Reply via email to