Faidon Liambotis has uploaded a new change for review.

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

Change subject: contint: use Apache <IfVersion> instead of os_version
......................................................................

contint: use Apache <IfVersion> instead of os_version

Similarly with the previous commit, drop $is_24 in favor of <IfVersion>.

Change-Id: If083cfdf515f6941eaa68e78d7b93d85996b837a
---
M modules/contint/manifests/localvhost.pp
M modules/contint/templates/apache/localvhost.erb
2 files changed, 7 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/19/178919/1

diff --git a/modules/contint/manifests/localvhost.pp 
b/modules/contint/manifests/localvhost.pp
index f449c55..bceffe2 100644
--- a/modules/contint/manifests/localvhost.pp
+++ b/modules/contint/manifests/localvhost.pp
@@ -20,8 +20,6 @@
     $log_prefix = $name,
 ){
 
-    $is_24 = os_version('ubuntu >= trusty')
-
     apache::site { "${name}.localhost":
         content => template('contint/apache/localvhost.erb'),
     }
diff --git a/modules/contint/templates/apache/localvhost.erb 
b/modules/contint/templates/apache/localvhost.erb
index e391f5a..900a6fa 100644
--- a/modules/contint/templates/apache/localvhost.erb
+++ b/modules/contint/templates/apache/localvhost.erb
@@ -28,26 +28,27 @@
     RewriteRule ^/([\w-]+)/wiki(/.*?)$ %{DOCUMENT_ROOT}/$1/w/index.php [L]
 
     <Directory />
-<% if @is_24 -%>
+       <IfVersion >= 2.4>
         Require all denied
-<% else -%>
+       <IfVersion < 2.4>
         Order deny,allow
         Deny from all
-<% end -%>
+       </IfVersion>
     </Directory>
 
     <Directory <%= @docroot %>>
         Options +Indexes
         Options FollowSymLinks
 
-<% if @is_24 -%>
+       <IfVersion >= 2.4>
         Require local
-<% else -%>
+       </IfVersion>
+       <IfVersion < 2.4>
         Order deny,allow
         Deny from all
         Allow from 127.0.0.1/32
         Allow from ::1/128
-<% end -%>
+       </IfVersion>
     </Directory>
 
     LogLevel warn

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

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

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

Reply via email to