From 8870fb197304bc8e4c58dc63ead94638c79b2358 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 16 Apr 2024 21:33:19 -0700 Subject: [PATCH] local tests passing now, nginx proxy working as expected without configs --- .../ansible/remote-localized-curl-tests.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 infra/static-vultr/ansible/remote-localized-curl-tests.yml diff --git a/infra/static-vultr/ansible/remote-localized-curl-tests.yml b/infra/static-vultr/ansible/remote-localized-curl-tests.yml new file mode 100644 index 0000000..b50829c --- /dev/null +++ b/infra/static-vultr/ansible/remote-localized-curl-tests.yml @@ -0,0 +1,36 @@ +--- +- hosts: webhost + remote_user: root + vars: + websites: + - shockrah.xyz + - resume.shockrah.xyz + - temper.tv + tasks: + + - name: Add local routing for the server confs + lineinfile: + path: /etc/hosts + state: present + line: "127.0.0.1 {{ item }}" + loop: "{{ websites }}" + - name: Curl the local endpoints to check connection nginx reverse proxy + uri: + url: "http://{{ item }}" + status_code: + - 200 + - 404 + loop: "{{ websites }}" + - name: Sanity Check the nginx reverse proxy + uri: + url: "http://not-real.{{ item }}" + loop: "{{ websites }}" + register: result + failed_when: result.status != -1 + - name: Cleanup /etc/hosts + lineinfile: + path: /etc/hosts + state: absent + line: "127.0.0.1 {{ item }}" + loop: "{{ websites }}" +