Mark Bergsma has uploaded a new change for review.

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


Change subject: Introduce an $extra_vcl instance parameter, use it for zero
......................................................................

Introduce an $extra_vcl instance parameter, use it for zero

Change-Id: Ibd0570871f4eec754e5d4da191355bfdf1689a55
---
M manifests/role/cache.pp
M manifests/varnish.pp
2 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/16/66116/1

diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp
index 8c9ff20..1545a7a 100644
--- a/manifests/role/cache.pp
+++ b/manifests/role/cache.pp
@@ -885,6 +885,7 @@
                varnish::instance { "mobile-frontend":
                        name => "frontend",
                        vcl => "mobile-frontend",
+                       extra_vcl => ["zero"],
                        port => 80,
                        admin_port => 6082,
                        directors => {
diff --git a/manifests/varnish.pp b/manifests/varnish.pp
index b61d4b8..cbb5828 100644
--- a/manifests/varnish.pp
+++ b/manifests/varnish.pp
@@ -48,8 +48,6 @@
                                content => 
template("varnish/geoip.inc.vcl.erb");
                        "/etc/varnish/device-detection.inc.vcl":
                                content => 
template("varnish/device-detection.inc.vcl.erb");
-                       "/etc/varnish/zero.inc.vcl":
-                               content => template("varnish/zero.inc.vcl.erb");
                        "/etc/varnish/errorpage.inc.vcl":
                                content => 
template("varnish/errorpage.inc.vcl.erb");
                }
@@ -58,6 +56,7 @@
        define instance(
                $name="",
                $vcl = "",
+               $extra_vcl = [],
                $port="80",
                $admin_port="6083",
                $storage="-s malloc,1G",
@@ -97,6 +96,16 @@
                # Install VCL include files shared by all instances
                require "varnish::common-vcl"
 
+               define extra-vcl($instancesuffix) {
+                       file { "/etc/varnish/${title}.inc.vcl":
+                               content => 
template("varnish/${title}.inc.vcl.erb"),
+                               notify => 
Exec["load-new-vcl-file${instancesuffix}"],
+                               mode => 0444;
+                       }
+               }
+               
+               extra-vcl { $extra_vcl: instancesuffix => $instancesuffix }
+
                file {
                        "/etc/init.d/varnish${instancesuffix}":
                                content => template("varnish/varnish.init.erb"),

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

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

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

Reply via email to