Move robots.txt in specific folder
This commit is contained in:
parent
1233619ce1
commit
dba96471d8
|
@ -86,7 +86,7 @@
|
|||
|
||||
- name: "Create robots.txt's folder"
|
||||
file:
|
||||
path: "/var/www/{{ item.server_name[0] }}"
|
||||
path: "/var/www/nginx/robots.txt/{{ item.server_name[0] }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
owner: www-data
|
||||
|
@ -101,7 +101,7 @@
|
|||
- name: "Add robots.txt"
|
||||
template:
|
||||
src: "robots.txt/robots.txt.j2"
|
||||
dest: "/var/www/{{ item.server_name[0] }}/robots.txt"
|
||||
dest: "/var/www/nginx/robots.txt/{{ item.server_name[0] }}/robots.txt"
|
||||
when:
|
||||
- item.robotstxt is defined and item.robotstxt == true
|
||||
- item.state == "present" or item.state is not defined
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
{% if item.robotstxt is defined and item.robotstxt == true %}
|
||||
location = /robots.txt {
|
||||
root /var/www/{{ item.server_name[0] }};
|
||||
root /var/www/nginx/robots.txt/{{ item.server_name[0] }};
|
||||
allow all;
|
||||
log_not_found off;
|
||||
access_log /dev/null;
|
||||
|
|
Loading…
Reference in New Issue