From aed755faa9545e3b862080fc03c918646a25938d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 2 Nov 2023 14:37:20 +0100 Subject: [PATCH] Prefer localhost over external domains should speed up some requests and make sure the server doesn't crash when it temporarilly loses internet access --- roles/builds.sr.ht/tasks/main.yml | 5 +++++ roles/git.sr.ht/tasks/main.yml | 5 +++++ roles/hub.sr.ht/tasks/main.yml | 5 +++++ roles/meta.sr.ht/tasks/main.yml | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/roles/builds.sr.ht/tasks/main.yml b/roles/builds.sr.ht/tasks/main.yml index 5f48597..d7472fa 100644 --- a/roles/builds.sr.ht/tasks/main.yml +++ b/roles/builds.sr.ht/tasks/main.yml @@ -7,6 +7,11 @@ - builds.sr.ht-worker state: latest +- name: Setup /etc/hosts localhost redirect + ansible.builtin.lineinfile: + path: /etc/hosts + line: "127.0.0.1 builds.{{ srht_domain }}" + - name: Setup Database ansible.builtin.import_tasks: db.yml diff --git a/roles/git.sr.ht/tasks/main.yml b/roles/git.sr.ht/tasks/main.yml index 91bafef..72cbec1 100644 --- a/roles/git.sr.ht/tasks/main.yml +++ b/roles/git.sr.ht/tasks/main.yml @@ -5,6 +5,11 @@ - git.sr.ht state: latest +- name: Setup /etc/hosts localhost redirect + ansible.builtin.lineinfile: + path: /etc/hosts + line: "127.0.0.1 git.{{ srht_domain }}" + - name: Setup Database ansible.builtin.import_tasks: db.yml diff --git a/roles/hub.sr.ht/tasks/main.yml b/roles/hub.sr.ht/tasks/main.yml index 3ac1dd4..a3ae7fb 100644 --- a/roles/hub.sr.ht/tasks/main.yml +++ b/roles/hub.sr.ht/tasks/main.yml @@ -5,6 +5,11 @@ - hub.sr.ht state: latest +- name: Setup /etc/hosts localhost redirect + ansible.builtin.lineinfile: + path: /etc/hosts + line: "127.0.0.1 hub.{{ srht_domain }} {{ srht_domain }}" + - name: Setup Database ansible.builtin.import_tasks: db.yml diff --git a/roles/meta.sr.ht/tasks/main.yml b/roles/meta.sr.ht/tasks/main.yml index d58b39d..6fc4cf8 100644 --- a/roles/meta.sr.ht/tasks/main.yml +++ b/roles/meta.sr.ht/tasks/main.yml @@ -5,6 +5,11 @@ - meta.sr.ht state: latest +- name: Setup /etc/hosts localhost redirect + ansible.builtin.lineinfile: + path: /etc/hosts + line: "127.0.0.1 meta.{{ srht_domain }}" + - name: Setup Database ansible.builtin.import_tasks: db.yml -- 2.38.5