jenkins-bot has submitted this change and it was merged.

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(-)

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



diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index eec5e72..00cddd1 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -262,6 +262,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..a083a50
--- /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: merged
Gerrit-Change-Id: I15d1c981f9e7d660ea4ca50ea16b8173cf66efa3
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to