Another attempt to fix the missing item.root.

This commit is contained in:
Andrea Dell'Amico 2022-06-11 18:08:11 +02:00
parent 017e29776e
commit bb11224fb6
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 3 additions and 2 deletions

View File

@ -22,11 +22,12 @@
group: root group: root
mode: 0444 mode: 0444
loop: '{{ nginx_virthosts }}' loop: '{{ nginx_virthosts }}'
when: item.root is defined and nginx_webroot != item.root when: nginx_webroot != item.root
when: when:
- nginx_install_robots_txt - nginx_install_robots_txt
- nginx_use_common_virthost - nginx_use_common_virthost
- item.root is defined
tags: [ 'nginx', 'robots_txt' ] tags: [ 'nginx', 'robots_txt' ]
- name: Remove the global robots.txt - name: Remove the global robots.txt
@ -48,7 +49,7 @@
loop: '{{ nginx_virthosts }}' loop: '{{ nginx_virthosts }}'
when: when:
- item.root is defined
- not nginx_install_robots_txt - not nginx_install_robots_txt
- nginx_use_common_virthost - nginx_use_common_virthost
- item.root is defined
tags: [ 'nginx', 'robots_txt' ] tags: [ 'nginx', 'robots_txt' ]