From bb11224fb626e0528b1b70ef9f519e9745cb8952 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sat, 11 Jun 2022 18:08:11 +0200 Subject: [PATCH] Another attempt to fix the missing item.root. --- tasks/robots-txt.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/robots-txt.yml b/tasks/robots-txt.yml index 3b98fef..e46a1e2 100644 --- a/tasks/robots-txt.yml +++ b/tasks/robots-txt.yml @@ -22,11 +22,12 @@ group: root mode: 0444 loop: '{{ nginx_virthosts }}' - when: item.root is defined and nginx_webroot != item.root + when: nginx_webroot != item.root when: - nginx_install_robots_txt - nginx_use_common_virthost + - item.root is defined tags: [ 'nginx', 'robots_txt' ] - name: Remove the global robots.txt @@ -48,7 +49,7 @@ loop: '{{ nginx_virthosts }}' when: + - item.root is defined - not nginx_install_robots_txt - nginx_use_common_virthost - - item.root is defined tags: [ 'nginx', 'robots_txt' ]