varnish on stretch now takes several -a arguments instead of one with multiple addresses
authorPeter Palfrader <peter@palfrader.org>
Mon, 28 May 2018 08:53:11 +0000 (10:53 +0200)
committerPeter Palfrader <peter@palfrader.org>
Mon, 28 May 2018 08:53:11 +0000 (10:53 +0200)
modules/varnish/manifests/config.pp

index a46f799..3e5c522 100644 (file)
@@ -1,5 +1,5 @@
 define varnish::config (
-       $listen = ':6081',
+       $listen = [':6081'],
        $source=undef,
        $content=undef,
        $ensure = 'present',
@@ -17,11 +17,13 @@ define varnish::config (
                                fail ( "No configuration found for ${name}" )
                        }
 
+                       $listenarr = [] + $listen
+                       $listenstr = join(prefix($listenarr, "-a "), " ")
                        systemd::override { 'varnish':
                                content  => @("EOF"),
                                        [Service]
                                        ExecStart=
-                                       ExecStart=/usr/sbin/varnishd -a ${listen} -T localhost:6082 -f /etc/varnish/${name}.vcl -S /etc/varnish/secret -s ${backend}
+                                       ExecStart=/usr/sbin/varnishd ${listenstr} -T localhost:6082 -f /etc/varnish/${name}.vcl -S /etc/varnish/secret -s ${backend}
                                        | EOF
                        }