start varnish only after network is online
authorPeter Palfrader <peter@palfrader.org>
Mon, 28 May 2018 18:13:08 +0000 (20:13 +0200)
committerPeter Palfrader <peter@palfrader.org>
Mon, 28 May 2018 18:13:08 +0000 (20:13 +0200)
modules/roles/manifests/snapshot_web.pp
modules/varnish/manifests/config.pp

index a20fb38..6054b52 100644 (file)
@@ -1,7 +1,6 @@
 class roles::snapshot_web {
        include apache2
        include apache2::rewrite
-       include stretch::network_online
 
        ensure_packages ( [
                "libapache2-mod-wsgi",
index e45edd8..0598e60 100644 (file)
@@ -12,6 +12,7 @@ define varnish::config (
        case $ensure {
                present: {
                        include varnish::base
+                       include stretch::network_online
 
                        if ! ($source or $content) {
                                fail ( "No configuration found for ${name}" )
@@ -21,6 +22,8 @@ define varnish::config (
                        $listenstr = join(prefix($listenarr, "-a "), " ")
                        systemd::override { 'varnish':
                                content  => @("EOF"),
+                                       [Unit]
+                                       After=network-online.target
                                        [Service]
                                        ExecStart=
                                        ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F ${listenstr} -T localhost:6082 -f /etc/varnish/${name}.vcl -S /etc/varnish/secret -s ${backend}