Dzahn has submitted this change and it was merged.

Change subject: Phabricator: support systemd as well as upstart.
......................................................................


Phabricator: support systemd as well as upstart.

Production currently runs on ubuntu, but I have been testing with
debian on labs.

Change-Id: Ideb6b9c177d554bd398cf71b4ed708859a17f80f
---
M modules/phabricator/manifests/vcs.pp
A modules/phabricator/templates/ssh-phab.service
2 files changed, 33 insertions(+), 9 deletions(-)

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



diff --git a/modules/phabricator/manifests/vcs.pp 
b/modules/phabricator/manifests/vcs.pp
index d02f0fc..fb43716 100644
--- a/modules/phabricator/manifests/vcs.pp
+++ b/modules/phabricator/manifests/vcs.pp
@@ -70,14 +70,6 @@
         notify  => Service['ssh-phab'],
     }
 
-    file { '/etc/init/ssh-phab.conf':
-        content => template('phabricator/sshd-phab.conf'),
-        mode    => '0644',
-        owner   => 'root',
-        group   => 'root',
-        require => Package['openssh-server'],
-    }
-
     # phd.user owns repo resources and both vcs and web user
     # must sudo to phd to for repo work.
     sudo::user { $vcs_user:
@@ -94,9 +86,26 @@
         require    => File['/usr/local/bin/git-http-backend'],
     }
 
+    if $::initsystem == 'upstart' {
+        $init_file = '/etc/init/ssh-phab.conf'
+        $init_template = template('phabricator/sshd-phab.conf')
+    } else {
+        $init_file = '/etc/systemd/system/ssh-phab.service'
+        $init_template = template('phabricator/ssh-phab.service')
+    }
+
+    file { $init_file:
+        content => $init_template,
+        mode    => '0644',
+        owner   => 'root',
+        group   => 'root',
+        require => Package['openssh-server'],
+    }
+
     service { 'ssh-phab':
         ensure     => running,
+        provider   => $::initsystem,
         hasrestart => true,
-        require    => File['/etc/init/ssh-phab.conf'],
+        require    => File[$init_file],
     }
 }
diff --git a/modules/phabricator/templates/ssh-phab.service 
b/modules/phabricator/templates/ssh-phab.service
new file mode 100644
index 0000000..6f2d1c9
--- /dev/null
+++ b/modules/phabricator/templates/ssh-phab.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Phabricator Secure Shell server
+After=network.target auditd.service
+ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
+
+[Service]
+EnvironmentFile=-/etc/default/ssh
+ExecStart=/usr/sbin/sshd -D -f<%= @sshd_config %>
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+Alias=ssh-phab.service

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ideb6b9c177d554bd398cf71b4ed708859a17f80f
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: 20after4 <mmod...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to