From 715ac65831fe9eb92a55566a072eddd12a535159 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 14 May 2024 22:19:22 -0700 Subject: [PATCH] Simple host names in etc/hosts which arent used just yet --- lab/setup-bare-cluster.yml | 8 ++++++++ lab/tasks/setup-etc-hosts.yml | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 lab/tasks/setup-etc-hosts.yml diff --git a/lab/setup-bare-cluster.yml b/lab/setup-bare-cluster.yml index 676f3ce..c5a2493 100644 --- a/lab/setup-bare-cluster.yml +++ b/lab/setup-bare-cluster.yml @@ -5,3 +5,11 @@ - name: Install K3S become: yes import_tasks: tasks/install-k3s.yml + tags: + - bare-setup + - name: Ensure the service DNS names are in /etc/hosts + become: yes + import_tasks: tasks/setup-etc-hosts.yml + tags: + - dns + diff --git a/lab/tasks/setup-etc-hosts.yml b/lab/tasks/setup-etc-hosts.yml new file mode 100644 index 0000000..2c49bbc --- /dev/null +++ b/lab/tasks/setup-etc-hosts.yml @@ -0,0 +1,9 @@ +# Allows the host to resolve names that we use in cluster +- name: Ensure host can resolve its own service names + lineinfile: + path: /etc/hosts + state: present + line: "192.168.1.100 {{ item }}" + loop: + - files.cluster.local + - nginx.cluster.local