BryanDavis has uploaded a new change for review.

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

Change subject: Add role::sal
......................................................................

Add role::sal

Add a role to provision the SAL viewing tool used to power
https://tools.wmflabs.org/sal/.

Change-Id: I15d1c981f9e7d660ea4ca50ea16b8173cf66efa3
---
M puppet/hieradata/common.yaml
A puppet/modules/role/manifests/sal.pp
A puppet/modules/role/templates/sal/apache.conf.erb
3 files changed, 67 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/74/230374/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 86caef8..e6d362f 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -263,6 +263,12 @@
 role::raita::dir: "%{hiera('mwv::services_dir')}/raita"
 role::raita::vhost_name: 'raita.local.wmftest.net'
 
+role::sal::vhost_name: "sal.local.wmftest.net%{::port_fragment}"
+role::sal::dir: "%{hiera('mwv::services_dir')}/sal"
+role::sal::env:
+  CACHE_DIR: /var/cache/sal
+  SLIM_MODE: development
+
 role::oauth::dir: "%{hiera('mwv::services_dir')}/oauth-hello-world"
 role::oauth::secret_key: 
292ed299345a01c1c0520b60f628c01ea817a0b3372b89dbb7637a2f678d018a
 role::oauth::example_consumer_key: 81cf4c1f885de4ed6b475c05c408c9b4
diff --git a/puppet/modules/role/manifests/sal.pp 
b/puppet/modules/role/manifests/sal.pp
new file mode 100644
index 0000000..28010de
--- /dev/null
+++ b/puppet/modules/role/manifests/sal.pp
@@ -0,0 +1,41 @@
+# == Class: role::sal
+# Provisions the sal application
+#
+# === Parameters
+# [*vhost_name*]
+#   Vhost name of sal service. Default 'sal.local.wmftest.net'.
+#
+# [*dir*]
+#   Deployment directory.
+#
+# [*env*]
+#   Hash of environment settings.
+#
+class role::sal(
+    $vhost_name,
+    $dir,
+    $env,
+) {
+    include ::elasticsearch
+
+    git::clone { 'sal':
+        directory => $dir,
+        remote => 'https://github.com/bd808/SAL.git',
+    }
+
+    php::composer::install { $dir:
+        require => Git::Clone['sal'],
+    }
+
+    file { '/var/cache/sal':
+        ensure  => directory,
+        owner   => 'www-data',
+        group   => 'www-data',
+        mode    => '0770',
+    }
+
+    apache::site { $vhost_name:
+        content => template('role/sal/apache.conf.erb'),
+        require => Git::Clone['sal'],
+    }
+}
diff --git a/puppet/modules/role/templates/sal/apache.conf.erb 
b/puppet/modules/role/templates/sal/apache.conf.erb
new file mode 100644
index 0000000..b85ccd3
--- /dev/null
+++ b/puppet/modules/role/templates/sal/apache.conf.erb
@@ -0,0 +1,20 @@
+ServerName <%= @vhost_name %>
+
+DocumentRoot <%= @dir %>/public
+
+<Directory />
+  Options FollowSymLinks
+  AllowOverride None
+  Require all denied
+</Directory>
+
+<Directory <%= @dir %>/public>
+  Require all granted
+  RewriteEngine On
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteRule "^.*" index.php/$0 [L,PT]
+</Directory>
+
+<% @env.each do |key, val| %>
+SetEnv <%= key %> <%= val %>
+<% end %>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15d1c981f9e7d660ea4ca50ea16b8173cf66efa3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>

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

Reply via email to