summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2021-08-18 08:43:50 +0200
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2021-08-18 08:43:50 +0200
commit8e5ffbff0cf79784a10a6695bb0830c920b60119 (patch)
treea99c14f341e2ec9086b141ba89a4ec50d405a6af
parent9a6a6aec02337f0813476ae435c5b57af63297c5 (diff)
downloadinfrastructure-8e5ffbff0cf79784a10a6695bb0830c920b60119.tar.gz
baserock_webserver/instance-config.yml: update to ubuntu/nginx
-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