summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-07-09 15:41:32 +0300
committerLars Wirzenius <liw@liw.fi>2017-07-09 15:41:32 +0300
commit4d8f931c98bb0a3c278ff80a4391426b0a877daf (patch)
treec36ff489a56ebf927be494d82e605b3378595b4f /roles
parent03bd5be6de02ffebe13d85083b5998d9c5a347f7 (diff)
downloaddebian-ansible-4d8f931c98bb0a3c278ff80a4391426b0a877daf.tar.gz
Add: robots.txt for cgit to exclude everyone
Diffstat (limited to 'roles')
-rw-r--r--roles/gitano_server/files/robots.txt2
-rw-r--r--roles/gitano_server/tasks/cgit.yml8
-rw-r--r--roles/gitano_server/templates/apache-cgit-host.j21
3 files changed, 11 insertions, 0 deletions
diff --git a/roles/gitano_server/files/robots.txt b/roles/gitano_server/files/robots.txt
new file mode 100644
index 0000000..1f53798
--- /dev/null
+++ b/roles/gitano_server/files/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /
diff --git a/roles/gitano_server/tasks/cgit.yml b/roles/gitano_server/tasks/cgit.yml
index ff0375a..05e92cb 100644
--- a/roles/gitano_server/tasks/cgit.yml
+++ b/roles/gitano_server/tasks/cgit.yml
@@ -46,6 +46,14 @@
mode: 0755
with_items: "{{ cgit_hosts }}"
notify: restart apache2
+
+- name: install robots.txt for cgi
+ copy:
+ src: robots.txt
+ dest: /usr/share/cgit/robots.txt
+ owner: root
+ group: root
+ mode: 0444
- name: enable virtualhosts
shell: "a2ensite {{ item }}"
diff --git a/roles/gitano_server/templates/apache-cgit-host.j2 b/roles/gitano_server/templates/apache-cgit-host.j2
index 2f9eeb0..522c3c9 100644
--- a/roles/gitano_server/templates/apache-cgit-host.j2
+++ b/roles/gitano_server/templates/apache-cgit-host.j2
@@ -18,6 +18,7 @@
DirectoryIndex /cgi-bin/cgit.cgi
Alias /cgit.png /usr/share/cgit/cgit.png
Alias /cgit.css /usr/share/cgit/cgit.css
+ Alias /robots.txt /usr/share/cgit/robots.txt
<Directory "/home/git/repos">
Options FollowSymlinks Indexes
AllowOverride none