From bba8c30b25cad915b527906de2588f495a01e493 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 14 Dec 2021 23:55:02 -0800 Subject: [PATCH] + Proof of concept playbooks for pushing website content So far testing with with athens-freechat.shockrah.xyz HTTP setup is working thus far and so certbot integrations are all that is left. Once those are done creating plays for all other websites should be fairly straight forward --- .../beta/base-site-conf/freechat.shockrah.xyz | 13 ++++++++++ playbooks/beta/base-site-conf/shockrah.xyz | 14 +++++++++++ playbooks/beta/local-freechat-push.yml | 20 +++++++++++++++ playbooks/beta/setup-nginx-confs.yml | 25 +++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 playbooks/beta/base-site-conf/freechat.shockrah.xyz create mode 100644 playbooks/beta/base-site-conf/shockrah.xyz create mode 100644 playbooks/beta/local-freechat-push.yml create mode 100644 playbooks/beta/setup-nginx-confs.yml diff --git a/playbooks/beta/base-site-conf/freechat.shockrah.xyz b/playbooks/beta/base-site-conf/freechat.shockrah.xyz new file mode 100644 index 0000000..425c172 --- /dev/null +++ b/playbooks/beta/base-site-conf/freechat.shockrah.xyz @@ -0,0 +1,13 @@ +# This file basically contains the base configuration for freechat.shockrah.xyz +# This is to be installed before running certbot against it as this only sets us +# up for correct HTTP(not TLS) based connections + +server { + root /var/www/freechat; + index index.html; + server_name athens-freechat.shockrah.xyz; + + location / { + try_files $uri $uri/ =404; + } +} diff --git a/playbooks/beta/base-site-conf/shockrah.xyz b/playbooks/beta/base-site-conf/shockrah.xyz new file mode 100644 index 0000000..9836ab4 --- /dev/null +++ b/playbooks/beta/base-site-conf/shockrah.xyz @@ -0,0 +1,14 @@ +# This file basically contains the base configuration for freechat.shockrah.xyz +# This is to be installed before running certbot against it as this only sets us +# up for correct HTTP(not TLS) based connections + +server { + root /var/www/shockrah.xyz; + index index.html; + server_name shockrah.xyz; + + location / { + try_files $uri $uri/ =404; + } +} + diff --git a/playbooks/beta/local-freechat-push.yml b/playbooks/beta/local-freechat-push.yml new file mode 100644 index 0000000..616565d --- /dev/null +++ b/playbooks/beta/local-freechat-push.yml @@ -0,0 +1,20 @@ +# This will take care of pushing out +--- +- hosts: web + remote_user: web + tasks: + - name: Clean out remote remote site content + file: + path: /var/www/freechat + state: absent + + - name: Push /public directory to /var/www/freechat + copy: + src: "{{FC_LOCAL_DOCS}}/public" + dest: /var/www/ + + - name: Pull up public directory + command: mv /var/www/public /var/www/freechat + + + diff --git a/playbooks/beta/setup-nginx-confs.yml b/playbooks/beta/setup-nginx-confs.yml new file mode 100644 index 0000000..2d47525 --- /dev/null +++ b/playbooks/beta/setup-nginx-confs.yml @@ -0,0 +1,25 @@ +--- +- hosts: beta + remote_user: ubuntu + become: yes + become_method: sudo + tasks: + - name: Push into sites-available + copy: + src: "{{item}}" + dest: /etc/nginx/sites-available/ + loop: + - base-site-conf/freechat.shockrah.xyz + + - name: Enable Freechat Docs site in Nginx + file: + src: /etc/nginx/sites-available/freechat.shockrah.xyz + dest: /etc/nginx/sites-enabled/freechat.shockrah.xyz + state: link + - name: Restart Nginx service + service: + name: nginx + state: restarted + + +