CORD-369 update apache2 config to forward UIs
Change-Id: I820d66fe9214970d0cfe6bf9e05b84d41105ffc2
diff --git a/roles/head-prologue/tasks/main.yml b/roles/head-prologue/tasks/main.yml
new file mode 100644
index 0000000..a8b4f2b
--- /dev/null
+++ b/roles/head-prologue/tasks/main.yml
@@ -0,0 +1,35 @@
+---
+
+# If using a MAAS based POD deployment then copy over an apache configuration
+# that forwards to the various UIs
+- name: Ensure CORD Apache Configuration
+ become: yes
+ copy:
+ src: files/cord-http.conf
+ dest: /etc/apache2/conf-available/cord-http.conf
+ owner: root
+ group: root
+ mode: 0644
+ notify: reload apache2
+ when: on_maas
+
+- name: Ensure Modules
+ become: yes
+ command: a2enmod {{ item }}
+ register: mod_proxy
+ changed_when: mod_proxy.stdout.find('already enabled') == -1
+ notify: reload apache2
+ when: on_maas
+ with_items:
+ - proxy
+ - proxy_http
+ - proxy_wstunnel
+ - rewrite
+
+- name: Enable CORD Apache Configuration
+ become: yes
+ command: a2enconf cord-http
+ register: en_cord_http
+ changed_when: en_cord_http.stdout.find('already enabled') == -1
+ notify: reload apache2
+ when: on_maas