summaryrefslogtreecommitdiff
path: root/playbooks/apache.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/apache.yaml')
-rw-r--r--playbooks/apache.yaml30
1 files changed, 30 insertions, 0 deletions
diff --git a/playbooks/apache.yaml b/playbooks/apache.yaml
new file mode 100644
index 0000000..f4121d8
--- /dev/null
+++ b/playbooks/apache.yaml
@@ -0,0 +1,30 @@
+---
+- name: "Configure apache vhost"
+ template:
+ src: ../templates/01_openbook.conf
+ dest: /etc/apache2/sites-available
+ mode: 0644
+ owner: root
+ group: root
+ register: vhost_result
+
+- name: "Configure apache modules"
+ shell: |
+ a2enmod headers
+ a2enmod proxy
+ a2enmod proxy_http
+ a2enmod socache_shmcb
+ a2enmod redirect
+ a2enmod ssl
+ a2dissite 000-default.conf
+ a2dissite default-ssl.conf
+ rm /etc/apache2/sites-available/000-default.conf
+ rm /etc/apache2/sites-available/default-ssl.conf
+ a2ensite 01_openbook.conf
+ when: vhost_result["changed"] == True
+
+- include: apache-ctl.yaml action=restart
+ when: vhost_result["changed"] == True
+
+- include: apache-ctl.yaml action=start
+ when: vhost_result["changed"] == False