Asher has uploaded a new change for review.

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


Change subject: ishmael conf/vhost
......................................................................

ishmael conf/vhost

Change-Id: Id184cc33bfd8a5500a5d28b907abf61b8bec81ba
---
A manifests/misc/ishmael.pp
A templates/apache/sites/ishmael.wikimedia.org.erb
A templates/ishmael/conf.php.erb
3 files changed, 88 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/31/70931/1

diff --git a/manifests/misc/ishmael.pp b/manifests/misc/ishmael.pp
new file mode 100644
index 0000000..ea279c3
--- /dev/null
+++ b/manifests/misc/ishmael.pp
@@ -0,0 +1,34 @@
+# ishmael web app
+#
+# NOTE: this does not install ishmael.. it could be git deployed, but it 
hasn't been moved to a wmf repo. for now:
+# cd /srv ; git clone https://github.com/asher/ishmael.git ; cd ishmael ; git 
clone https://github.com/asher/ishmael.git sample
+#
+class misc::ishmael {
+       system_role { "misc::ishmael": description => "ishmael server" }
+
+       include passwords::ldap::wmf_cluster
+       $proxypass = $passwords::ldap::wmf_cluster::proxypass
+
+       file { '/etc/apache2/sites-available/ishmael.wikimedia.org':
+               ensure => present,
+               owner  => 'root',
+               group  => 'root',
+               mode   => '0440',
+               content => template('apache/sites/ishmael.wikimedia.org.erb');
+       }
+
+       define ishmael_config( file=$title, review_table='%query_review', 
history_table='%query_review_history' ) {
+               include passwords::mysql::querydigest
+
+               file { $file:
+                       owner => "root",
+                       group => "root",
+                       mode => 0444,
+                       content => template('ishmael/conf.php.erb');
+               }
+       }
+
+       ishmael_config { '/srv/ishmael/conf.php': }
+       ishmael_config { '/srv/ishmael/sample/conf.php':
+               review_table => '%tcpquery_review', history_table => 
'%tcpquery_review_history' }
+}
diff --git a/templates/apache/sites/ishmael.wikimedia.org.erb 
b/templates/apache/sites/ishmael.wikimedia.org.erb
new file mode 100644
index 0000000..48f92a2
--- /dev/null
+++ b/templates/apache/sites/ishmael.wikimedia.org.erb
@@ -0,0 +1,39 @@
+# vim: filetype=apache
+
+NameVirtualHost *:80
+NameVirtualHost *:443
+
+<VirtualHost *:443>
+       ServerName ishmael.wikimedia.org
+       SSLEngine On
+       SSLCertificateFile /etc/ssl/private/star.wikimedia.org.pem
+       SSLCertificateKeyFile /etc/ssl/private/star.wikimedia.org.key
+       SSLCACertificateFile /etc/ssl/certs/RapidSSL_CA.pem
+       DocumentRoot /srv/ishmael
+
+       <Directory "/srv/ishmael">
+               Options FollowSymLinks
+               SSLRequireSSL
+               Options ExecCGI
+               DirectoryIndex index.php
+               AllowOverride AuthConfig
+               Order Allow,Deny
+               Allow From All
+               AuthName "WMF Labs (use wiki login name not shell)"
+               AuthType Basic
+               AuthBasicProvider ldap
+               AuthLDAPBindDN cn=proxyagent,ou=profile,dc=wikimedia,dc=org
+               AuthLDAPBindPassword <%= proxypass %>
+               AuthLDAPURL "ldaps://virt0.wikimedia.org 
virt1000.wikimedia.org/ou=people,dc=wikimedia,dc=org?cn"
+               Require ldap-group cn=wmf,ou=groups,dc=wikimedia,dc=org
+       </Directory>
+</VirtualHost>
+
+<VirtualHost *:80>
+       ServerName ishmael.wikimedia.org
+       DocumentRoot /srv/ishmael
+
+       RewriteEngine on
+       RewriteCond %{SERVER_PORT} !^443$
+       RewriteRule ^/(.*)$ https://icinga-admin.wikimedia.org/$1 [L,R]
+</VirtualHost>
diff --git a/templates/ishmael/conf.php.erb b/templates/ishmael/conf.php.erb
new file mode 100644
index 0000000..a3cbf24
--- /dev/null
+++ b/templates/ishmael/conf.php.erb
@@ -0,0 +1,15 @@
+<?php
+
+       $conf['db_user'] = 'ops';
+       $conf['db_password'] = '<%= 
scope.lookupvar('passwords::mysql::querydigest::mysql_ops_db') %>';
+
+       $conf['db_database_mk'] = 'query_digests';
+       $conf['db_database_live'] = ''; # database in which the actual data 
lives, for EXPLAIN purposes
+       $conf['db_query_review_table'] = '<%= review_table %>';
+       $conf['db_query_review_history_table'] = '<%= history_table %>';
+       $conf['db_central_host'] = '<%= db_central_host %>';
+
+       $conf['limit'] = 75;
+       $conf['explain'] = false;
+       $conf['anon'] = true;
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id184cc33bfd8a5500a5d28b907abf61b8bec81ba
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Asher <[email protected]>

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

Reply via email to