summaryrefslogtreecommitdiff
path: root/baserock_webserver/instance-config.yml
diff options
context:
space:
mode:
Diffstat (limited to 'baserock_webserver/instance-config.yml')
-rw-r--r--baserock_webserver/instance-config.yml39
1 files changed, 33 insertions, 6 deletions
diff --git a/baserock_webserver/instance-config.yml b/baserock_webserver/instance-config.yml
index 6923f305..60e7bf00 100644
--- a/baserock_webserver/instance-config.yml
+++ b/baserock_webserver/instance-config.yml
@@ -3,7 +3,6 @@
# Tested against Fedora 26 base image.
---
- hosts: webserver
- gather_facts: false
become: yes
become_method: sudo
tasks:
@@ -14,10 +13,38 @@
mountpoint: /srv
- name: /srv/download.baserock.org/
- file: path=/srv/download.baserock.org/ owner=fedora state=directory
+ file:
+ path: /srv/download.baserock.org/
+ owner: "{{ ansible_user_id }}"
+ state: directory
- - name: Cherokee configuration
- copy: src=etc/cherokee/cherokee.conf dest=/etc/cherokee/
+ - name: Create the nginx configuration files
+ template:
+ src: files/{{ item }}
+ dest: /etc/nginx/sites-available/{{ item }}
+ become: yes
+ notify:
+ - restart nginx
+ with_items:
+ - download-baserock-org.conf
+ - irclogs-baserock-org.conf
+
+ - name: Enable nginx sites
+ file:
+ src: ../sites-available/{{ item }}
+ dest: /etc/nginx/sites-enabled/{{ item }}
+ state: link
+ become: yes
+ notify:
+ - restart nginx
+ with_items:
+ - download-baserock-org.conf
+ - irclogs-baserock-org.conf
+
+ handlers:
+ - name: restart nginx
+ service:
+ name: nginx
+ state: restarted
+ become: yes
- - name: (re)start Cherokee webserver
- service: name=cherokee enabled=yes state=restarted