Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Update robots.txt.j2 to accept Allow rule and multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
john2x committed Jan 14, 2019
1 parent cde5689 commit a7eb846
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
- Role: nginx
- Modified robots.txt.j2 to accept the Allow rule.
- Modified robots.txt.j2 to accept either a single string or a list of strings for agent, disallow, and allow.

- abbey.py
- Removed abbey.py

Expand Down
23 changes: 23 additions & 0 deletions playbooks/roles/nginx/templates/edx/app/nginx/robots.txt.j2
@@ -1,5 +1,28 @@
{% for item in NGINX_ROBOT_RULES %}
{% if item.agent is string %}
User-agent: {{ item.agent }}
{% else %}
{% for agent in item.agent %}
User-agent: {{ agent }}
{% endfor %}
{% endif %}
{% if item.allow is defined %}
{% if item.allow is string %}
Allow: {{ item.allow }}
{% else %}
{% for allow in item.allow %}
Allow: {{ allow }}
{% endfor %}
{% endif %}
{% endif %}
{% if item.disallow is defined %}
{% if item.disallow is string %}
Disallow: {{ item.disallow }}
{% else %}
{% for disallow in item.disallow %}
Disallow: {{ disallow }}
{% endfor %}
{% endif %}
{% endif %}

{% endfor %}

0 comments on commit a7eb846

Please sign in to comment.