local tests passing now, nginx proxy working as expected without configs

This commit is contained in:
shockrah 2024-04-16 21:33:19 -07:00
parent 5337fabe17
commit 8870fb1973

View File

@ -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 }}"