From 91cf63398ef68240dd07c3c7254879daaed79592 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Wed, 28 Dec 2022 20:07:11 -0800 Subject: [PATCH] ramble-hard --- ramble-hard/main.yml | 2 ++ ramble-hard/nginx/main.yml | 48 +++++++++++++++++++------------------- ramble-hard/pleroma/03.yml | 1 + 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/ramble-hard/main.yml b/ramble-hard/main.yml index 11496a7..b795840 100644 --- a/ramble-hard/main.yml +++ b/ramble-hard/main.yml @@ -1,3 +1,5 @@ - hosts: ramble-hard + vars_files: + - ../vars.private tasks: diff --git a/ramble-hard/nginx/main.yml b/ramble-hard/nginx/main.yml index dc1cbcf..48d6920 100644 --- a/ramble-hard/nginx/main.yml +++ b/ramble-hard/nginx/main.yml @@ -35,31 +35,31 @@ dest: /etc/cron.daily/renew-certs mode: +x -# - name: Set up nginx proxies -# hosts: ramble-hard -# vars_files: -# - ../vars.private -# tasks: +- name: Set up nginx proxies + hosts: ramble-hard + vars_files: + - ../vars.private + tasks: -# - template: -# src: nginx.conf -# dest: /etc/nginx/sites-available/{{ item.key }}.conf -# vars: -# server_name: "{{ item.value['subdomain'] | default(item.key) }}.{{ domain }}" -# port: "{{ item.value['port'] }}" -# loop: "{{ apps | dict2items }}" -# notify: Restart nginx + - template: + src: nginx.conf + dest: /etc/nginx/sites-available/{{ item.key }}.conf + vars: + server_name: "{{ item.value['subdomain'] | default(item.key) }}.{{ domain }}" + port: "{{ item.value['port'] }}" + loop: "{{ apps | dict2items }}" + notify: Restart nginx -# - file: -# src: /etc/nginx/sites-available/{{ item.key }}.conf -# dest: /etc/nginx/sites-enabled/{{ item.key }}.conf -# state: link -# loop: "{{ apps | dict2items }}" -# notify: Restart nginx + - file: + src: /etc/nginx/sites-available/{{ item.key }}.conf + dest: /etc/nginx/sites-enabled/{{ item.key }}.conf + state: link + loop: "{{ apps | dict2items }}" + notify: Restart nginx - # handlers: + handlers: - # - name: Restart nginx - # service: - # name: nginx - # state: restarted + - name: Restart nginx + service: + name: nginx + state: restarted diff --git a/ramble-hard/pleroma/03.yml b/ramble-hard/pleroma/03.yml index b0b75e8..7747af6 100644 --- a/ramble-hard/pleroma/03.yml +++ b/ramble-hard/pleroma/03.yml @@ -32,6 +32,7 @@ dest: /etc/nginx/sites-available/pleroma.conf remote_src: true notify: Restart nginx + # TODO: https://mastodon.bawue.social/@ixs/109514849935951693 - file: src: /etc/nginx/sites-available/pleroma.conf dest: /etc/nginx/sites-enabled/pleroma.conf