summaryrefslogtreecommitdiff
path: root/playbooks/apache.yaml
diff options
context:
space:
mode:
authorCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-12-13 18:54:21 -0700
committerCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-12-13 18:54:21 -0700
commit32086f62131e1b813e2f3d97bc2c78f66c6a3154 (patch)
tree2005059011aea64121af64de5b3567fd0dcbca3b /playbooks/apache.yaml
parent21fa10807bb475bff42a997ac4add3cc7e6346f9 (diff)
adding files
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