From 5337fabe17df863f86fb079c0d75480d270e3ba3 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 16 Apr 2024 20:37:47 -0700 Subject: [PATCH] Setting up all nginx websites on the host --- infra/static-vultr/ansible/.gitignore | 2 ++ .../ansible/files/{temper.tv => temper.tv.conf} | 0 infra/static-vultr/ansible/static-host-setup.yml | 7 +++++++ infra/static-vultr/ansible/tasks/nginx-setup.yml | 12 ++++++------ 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 infra/static-vultr/ansible/.gitignore rename infra/static-vultr/ansible/files/{temper.tv => temper.tv.conf} (100%) create mode 100644 infra/static-vultr/ansible/static-host-setup.yml diff --git a/infra/static-vultr/ansible/.gitignore b/infra/static-vultr/ansible/.gitignore new file mode 100644 index 0000000..3c2e90b --- /dev/null +++ b/infra/static-vultr/ansible/.gitignore @@ -0,0 +1,2 @@ +inventory.ini +known_hosts diff --git a/infra/static-vultr/ansible/files/temper.tv b/infra/static-vultr/ansible/files/temper.tv.conf similarity index 100% rename from infra/static-vultr/ansible/files/temper.tv rename to infra/static-vultr/ansible/files/temper.tv.conf diff --git a/infra/static-vultr/ansible/static-host-setup.yml b/infra/static-vultr/ansible/static-host-setup.yml new file mode 100644 index 0000000..3d9eb2b --- /dev/null +++ b/infra/static-vultr/ansible/static-host-setup.yml @@ -0,0 +1,7 @@ +# This playbook basically guarantees that the host is in a production ready state +--- +- hosts: webhost + remote_user: root + tasks: + - name: Setup nginx + import_tasks: tasks/nginx-setup.yml diff --git a/infra/static-vultr/ansible/tasks/nginx-setup.yml b/infra/static-vultr/ansible/tasks/nginx-setup.yml index 922ccdd..9c2fcbb 100644 --- a/infra/static-vultr/ansible/tasks/nginx-setup.yml +++ b/infra/static-vultr/ansible/tasks/nginx-setup.yml @@ -17,18 +17,18 @@ src: "files/{{ item }}" dest: /etc/nginx/sites-available/ loop: - - shockrah.xyz - - resume.shockrah.xyz - - temper.tv + - shockrah.xyz.conf + - resume.shockrah.xyz.conf + - temper.tv.conf - 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 + - shockrah.xyz.conf + - resume.shockrah.xyz.conf + - temper.tv.conf - name: Restart nginx conf to pick up new config changes service: name: nginx