From cd42d0c281ebf7e1750ae0859a147c962202835f Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 15 Apr 2024 17:58:23 -0700 Subject: [PATCH] nginx setup with anisble --- .../ansible/files/shockrah.xyz.conf | 0 .../ansible/tasks/nginx-setup.yml | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 infra/static-vultr/ansible/files/shockrah.xyz.conf create mode 100644 infra/static-vultr/ansible/tasks/nginx-setup.yml diff --git a/infra/static-vultr/ansible/files/shockrah.xyz.conf b/infra/static-vultr/ansible/files/shockrah.xyz.conf new file mode 100644 index 0000000..e69de29 diff --git a/infra/static-vultr/ansible/tasks/nginx-setup.yml b/infra/static-vultr/ansible/tasks/nginx-setup.yml new file mode 100644 index 0000000..922ccdd --- /dev/null +++ b/infra/static-vultr/ansible/tasks/nginx-setup.yml @@ -0,0 +1,35 @@ +- name: Install nginx + apt: + name: nginx + update_cache: yes +- name: Create user for nginx purposes + user: + name: nginx + shell: /bin/bash + create_home: false +- name: Create nginx website directory + file: + state: directory + owner: nginx + path: /opt/nginx +- name: Copy over the nginx.conf files for each server + copy: + src: "files/{{ item }}" + dest: /etc/nginx/sites-available/ + loop: + - shockrah.xyz + - resume.shockrah.xyz + - temper.tv +- name: Enable the site configs with sym links + file: + src: "/etc/nginx/sites-available/{{ item }}" + dest: "/etc/nginx/sites-enabled/{{ item }}" + state: link + loop: + - shockrah.xyz + - resume.shockrah.xyz + - temper.tv +- name: Restart nginx conf to pick up new config changes + service: + name: nginx + state: restarted