]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
puddle: add "dev-puddle" virtualhost 112/head
authorKen Dreyer <kdreyer@redhat.com>
Fri, 14 Aug 2015 18:55:38 +0000 (12:55 -0600)
committerKen Dreyer <kdreyer@redhat.com>
Fri, 14 Aug 2015 19:38:32 +0000 (13:38 -0600)
In DNS, dev-puddle is a CNAME to puddle. Set up Nginx's configuration
file to handle this new name and route the requests to a dedicated
"dev-puddle" htdocs directory.

Update the nginx task to create multiple docroots, and add "dev-puddle"
to be the second one.

roles/puddle/tasks/nginx.yml
roles/puddle/templates/nginx.conf

index b5d0fe3941384dbceb57faeedaa3da6c6f9289f4..0ad6715ace0449a2a336878292f7e4552e4ca58d 100644 (file)
@@ -4,12 +4,15 @@
     name: nginx
     state: present
 
-- name: create nginx docroot
+- name: create nginx docroots
   file:
-    path: "/var/www/{{ ansible_hostname }}/htdocs"
+    path: "/var/www/{{ item }}/htdocs"
     owner: "{{ puddle_user }}"
     mode: 0755
     state: directory
+  with_items:
+    - "dev-{{ ansible_hostname }}"
+    - "{{ ansible_hostname }}"
 
 - name: configure nginx
   template:
index e2f4b085680f58c816fea246aee9f65dfa23c33f..85ab525919d5de93c83935754b7967b56f34a392 100644 (file)
@@ -71,4 +71,28 @@ http {
             text/plain manifest MD5SUM SHA1SUM SHA256SUM;
         }
     }
+
+    server {
+        listen       80;
+        listen       [::]:80;
+        server_name  dev-{{ ansible_fqdn }};
+        root         /var/www/dev-{{ ansible_hostname }}/htdocs;
+
+        location / {
+            autoindex on;
+            autoindex_exact_size off;
+        }
+
+        # Some of distill's files have no suffix and are simply plaintext.
+        location ~ (COMPOSE_ID|STATUS)$ {
+            default_type text/plain;
+        }
+
+        types {
+            # Plaintext files from puddle and distill:
+            text/plain conf log repo txt;
+            # More from distill:
+            text/plain manifest MD5SUM SHA1SUM SHA256SUM;
+        }
+    }
 }