From e5c12f06285cd58b7a242b6ca9c8e628ea4e58dd Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Thu, 12 Nov 2020 22:59:46 +0100 Subject: [PATCH] bundles/nginx: create webroot directories after bundle:zfs is done --- bundles/nginx/items.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bundles/nginx/items.py b/bundles/nginx/items.py index b962935..ea793f2 100644 --- a/bundles/nginx/items.py +++ b/bundles/nginx/items.py @@ -78,7 +78,14 @@ for vhost, config in node.metadata.get('nginx', {}).get('vhosts', {}).items(): } if not 'webroot' in config: - directories['/var/www/{}'.format(vhost)] = config.get('webroot_config', {}) + directories['/var/www/{}'.format(vhost)] = {} + + if node.has_bundle('zfs'): + directories['/var/www/{}'.format(vhost)]['needs'] = { + 'bundle:zfs', + } + + directories['/var/www/{}'.format(vhost)].update(config.get('webroot_config', {})) if node.metadata['nginx']['use_ssl_for_all_connections']: files['/etc/nginx/sites/{}'.format(vhost)]['needs'].add('action:letsencrypt_update_certificates')