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' ]