From 21426572cc4454cd65ac0b8d1495e06953e29066 Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Sun, 8 Sep 2024 08:05:58 -0400 Subject: [PATCH] gitea.kwerezigua.org is now online --- playbooks/setup_webserver.yml | 27 +++++++++++++++++++++++++++ templates/Caddyfile.j2 | 3 +++ 2 files changed, 30 insertions(+) create mode 100644 playbooks/setup_webserver.yml create mode 100644 templates/Caddyfile.j2 diff --git a/playbooks/setup_webserver.yml b/playbooks/setup_webserver.yml new file mode 100644 index 0000000..964252c --- /dev/null +++ b/playbooks/setup_webserver.yml @@ -0,0 +1,27 @@ +--- +- name: installs and setups nginx on hosts + hosts: aws + become: true + vars: + gitea_website: gitea.kwerezigua.org + proxy: localhost:3000 + tasks: + - name: install nginx and supporting packages + apt: + name: "{{item}}" + state: latest + loop: + - caddy + - ufw + + + - name: edit caddyfile with desired services + ansible.builtin.template: + src: ../templates/Caddyfile.j2 + dest: /etc/caddy/Caddyfile + + - name: start caddy service + systemd: + name: caddy + state: started + enabled: true diff --git a/templates/Caddyfile.j2 b/templates/Caddyfile.j2 new file mode 100644 index 0000000..be1abb8 --- /dev/null +++ b/templates/Caddyfile.j2 @@ -0,0 +1,3 @@ +{{gitea_website}} { + reverse_proxy {{proxy}} +}