From 8deca5e2e4da7378eb7c9916ca96fcc46e203530 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 28 May 2018 20:13:08 +0200 Subject: [PATCH] start varnish only after network is online --- modules/roles/manifests/snapshot_web.pp | 1 - modules/varnish/manifests/config.pp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/roles/manifests/snapshot_web.pp b/modules/roles/manifests/snapshot_web.pp index a20fb381f..6054b5227 100644 --- a/modules/roles/manifests/snapshot_web.pp +++ b/modules/roles/manifests/snapshot_web.pp @@ -1,7 +1,6 @@ class roles::snapshot_web { include apache2 include apache2::rewrite - include stretch::network_online ensure_packages ( [ "libapache2-mod-wsgi", diff --git a/modules/varnish/manifests/config.pp b/modules/varnish/manifests/config.pp index e45edd824..0598e605e 100644 --- a/modules/varnish/manifests/config.pp +++ b/modules/varnish/manifests/config.pp @@ -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} -- 2.20.1