Commit fb8f3c51 by Feanil Patel

Add a robots.txt file if robot rules are defined.

parent 4fa26c53
......@@ -52,3 +52,5 @@ nginx_cfg:
# nginx configuration
version_html: "{{ nginx_app_dir }}/versions.html"
version_json: "{{ nginx_app_dir }}/versions.json"
NGINX_ROBOT_RULES: [ ]
......@@ -41,6 +41,13 @@
owner=root group=root mode=0600
notify: reload nginx
- name: Create robot rules
template: >
src=robots.txt.j2 dest={{ nginx_app_dir }}/robots.txt
owner=root group={{ common_web_user }} mode=0644
notify: reload nginx
when: NGINX_ROBOT_RULES|length > 0
- name: Creating link for common nginx configuration
file: >
src={{ nginx_sites_available_dir }}/edx-release
......
{% for item in NGINX_ROBOT_RULES %}
User-agent: {{ item.agent }}
Disallow: {{ item.disallow }}
{% endfor %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment