From 72c45c7bb77b161d90f3231a0d5ffefb400e6fdd Mon Sep 17 00:00:00 2001 From: shockrah Date: Thu, 27 Jan 2022 02:14:20 -0800 Subject: [PATCH] + CLippable service setup --- playbooks/alpha/clippable.yml | 31 ++++++++++++++++++++++++ playbooks/alpha/nginx/clippable.yml | 30 +++++++++++++++++++++++ playbooks/alpha/nginx/clips.shockrah.xyz | 12 +++++++++ 3 files changed, 73 insertions(+) create mode 100644 playbooks/alpha/clippable.yml create mode 100644 playbooks/alpha/nginx/clippable.yml create mode 100644 playbooks/alpha/nginx/clips.shockrah.xyz diff --git a/playbooks/alpha/clippable.yml b/playbooks/alpha/clippable.yml new file mode 100644 index 0000000..34cca6e --- /dev/null +++ b/playbooks/alpha/clippable.yml @@ -0,0 +1,31 @@ +--- +- hosts: alpha + become: yes + vars: + CLIPPABLE_ROOT: /mnt/drive1 + tasks: + - name: Create mountpoints for volumes + file: + state: directory + path: "{{ CLIPPABLE_ROOT }}/{{ item }}" + loop: + - clips/ + - thumbnails/ + + - name: Pull latest Clippable Image + community.docker.docker_container: + name: clippable + image: registry.gitlab.com/shockrah/clippable:latest + pull: yes + restart_policy: always + recreate: yes + env: + SITE_NAME: "Shockrah's Clips" + SITE_DESC: "Short clips of random stuff I do" + SITE_URL: "https://clips.shockrah.xyz" + ports: + - "8482:8482" + volumes: + - "{{CLIPPABLE_ROOT}}/clips:/media/clips" + - "{{CLIPPABLE_ROOT}}/thumbnails:/media/thumbnails" + diff --git a/playbooks/alpha/nginx/clippable.yml b/playbooks/alpha/nginx/clippable.yml new file mode 100644 index 0000000..00cdbb9 --- /dev/null +++ b/playbooks/alpha/nginx/clippable.yml @@ -0,0 +1,30 @@ +# It is important to keep in mind that these websites are to be served under +# either port 80 or port 443. The reasoning for allowing port 80 connections +# is because the content here is not sensitive and I'm 100% sure I'm going +# to get traffic from glow-friends so there + +--- +- hosts: beta + become: yes + tasks: + - name: Push clips.shockrah.xyz config(nginx) + copy: + src: "clips.shockrah.xyz" + dest: "/etc/nginx/sites-available/clips.shockrah.xyz" + + - name: Enable clips nginx config + file: + src: /etc/nginx/sites-available/clips.shockrah.xyz + dest: /etc/nginx/sites-enabled/clips.shockrah.xyz + state: link + + - name: Restart Nginx + service: + name: nginx + state: restarted + + - name: Install New Certificate for all sites + command: > + certbot -n --nginx -m "dev@shockrah.xyz" --agree-tos + --domains clips.shockrah.xyz + diff --git a/playbooks/alpha/nginx/clips.shockrah.xyz b/playbooks/alpha/nginx/clips.shockrah.xyz new file mode 100644 index 0000000..cc44e25 --- /dev/null +++ b/playbooks/alpha/nginx/clips.shockrah.xyz @@ -0,0 +1,12 @@ +# This file contains a base configuration file for the projectathens +# It is to be overwritten by certbot later on so adjusting this config +# should not happen on the target server + +server { + server_name clips.shockrah.xyz; + location / { + proxy_pass http://127.0.0.1:8482; + } +} + +