BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401896 )

Change subject: thumbor: pass vars to systemd service template
......................................................................

thumbor: pass vars to systemd service template

Bug: T184152
Change-Id: Iab373e7c7f505af865144b7681cab26519567eee
---
M puppet/modules/thumbor/manifests/service.pp
R puppet/modules/thumbor/templates/systemd/thumbor.epp
2 files changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/96/401896/1

diff --git a/puppet/modules/thumbor/manifests/service.pp 
b/puppet/modules/thumbor/manifests/service.pp
index 56c54b0..b8187c0 100644
--- a/puppet/modules/thumbor/manifests/service.pp
+++ b/puppet/modules/thumbor/manifests/service.pp
@@ -27,12 +27,12 @@
     $port = $name
 
     systemd::service { "thumbor-${port}":
-        ensure         => 'present',
-        require        => [
+        ensure             => 'present',
+        require            => [
             Package['python-thumbor-wikimedia'],
             File['/etc/firejail/thumbor.profile'],
         ],
-        service_params => {
+        service_params     => {
             subscribe => [
                 File[
                     '/etc/tinyrgb.icc',
@@ -41,7 +41,13 @@
                 $cfg_files,
             ],
         },
-        template_name  => 'thumbor',
+        template_name      => 'thumbor',
+        epp_template       => true,
+        template_variables => {
+            'port'    => $port,
+            'tmp_dir' => $tmp_dir,
+            'cfg_dir' => $cfg_dir,
+        },
     }
 
     file { "/usr/lib/tmpfiles.d/thumbor@${port}.conf":
diff --git a/puppet/modules/thumbor/templates/systemd/thumbor.erb 
b/puppet/modules/thumbor/templates/systemd/thumbor.epp
similarity index 66%
rename from puppet/modules/thumbor/templates/systemd/thumbor.erb
rename to puppet/modules/thumbor/templates/systemd/thumbor.epp
index 8de1750..0279833 100644
--- a/puppet/modules/thumbor/templates/systemd/thumbor.erb
+++ b/puppet/modules/thumbor/templates/systemd/thumbor.epp
@@ -9,7 +9,7 @@
 SyslogIdentifier=thumbor
 MemoryMax=1G
 # To assign CPU affinity we consider that the base port is 8889 (Thumbor's 
default + 1)
-ExecStart=/usr/bin/taskset -c <%= Integer(@port) - 8889 %> /usr/bin/firejail 
--profile=/etc/firejail/thumbor.profile --env=TMPDIR=<%= @tmp_dir 
%>/thumbor@<%= @port %> --env=MAGICK_TEMPORARY_PATH=<%= @tmp_dir %>/thumbor@<%= 
@port %> --env=MAGICK_DISK_LIMIT=900MB --env=MAGICK_MEMORY_LIMIT=900MB -- 
/usr/bin/thumbor -p <%= @port %> -c <%= @cfg_dir %>
+ExecStart=/usr/bin/taskset -c <%= Integer($port) - 8889 %> /usr/bin/firejail 
--profile=/etc/firejail/thumbor.profile --env=TMPDIR=<%= $tmp_dir 
%>/thumbor@<%= $port %> --env=MAGICK_TEMPORARY_PATH=<%= $tmp_dir %>/thumbor@<%= 
$port %> --env=MAGICK_DISK_LIMIT=900MB --env=MAGICK_MEMORY_LIMIT=900MB -- 
/usr/bin/thumbor -p <%= $port %> -c <%= $cfg_dir %>
 Restart=always
 
 [Install]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab373e7c7f505af865144b7681cab26519567eee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

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

Reply via email to