From 8e5ffbff0cf79784a10a6695bb0830c920b60119 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Wed, 18 Aug 2021 08:43:50 +0200 Subject: baserock_webserver/instance-config.yml: update to ubuntu/nginx --- baserock_webserver/instance-config.yml | 39 ++++++++++++++++++++++++++++------ 1 file 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 -- cgit v1.2.1