feat: add talos support (#1192)

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-19 05:36:25 -05:00
1 parent cec32120db
commit 91d8b84f3c
33 files changed
+537 -42

No files matched your search

+11 -4
View File
@@ -1,7 +1,6 @@
---
- name: Check if required CLI tools are present
ansible.builtin.shell: |
command -v {{ item }} >/dev/null 2>&1
ansible.builtin.shell: command -v {{ item }} >/dev/null 2>&1
loop: ["age", "cloudflared", "flux", "sops", "jq", "kubeconform", "kustomize"]
changed_when: false
check_mode: false
@@ -10,10 +9,18 @@
- name: Check if required CLI tools are present for k0s
when: bootstrap_distribution == "k0s"
ansible.builtin.shell: |
command -v {{ item }} >/dev/null 2>&1
ansible.builtin.shell: command -v {{ item }} >/dev/null 2>&1
loop: ["k0sctl"]
changed_when: false
check_mode: false
register: result
failed_when: result.rc != 0 and result.rc != 127
- name: Check if required CLI tools are present for talos
when: bootstrap_distribution == "talos"
ansible.builtin.shell: command -v {{ item }} >/dev/null 2>&1
loop: ["talhelper", "talosctl"]
changed_when: false
check_mode: false
register: result
failed_when: result.rc != 0 and result.rc != 127
+15 -13
View File
@@ -1,11 +1,4 @@
---
- name: Set reachable address
ansible.builtin.set_fact:
current_address: "{{ item.external_address | default(item.address) }}"
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
loop_control:
label: "{{ item.address }}"
- name: Check if master node count is odd
ansible.builtin.assert:
that:
@@ -161,7 +154,6 @@
fail_msg: Node address {{ item.address }} is not within {{ bootstrap_node_cidr }}.
quiet: true
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
when: item.external_address is not defined
loop_control:
label: "{{ item.address }}"
@@ -193,14 +185,24 @@
fail_msg: All node names are not unique.
quiet: true
- name: Check if nodes SSH ports are reachable
when: not ci_test | default(false)
- name: Check if SSH ports are reachable
when: (not ci_test | default(false)) and (not bootstrap_distribution == "talos")
ansible.builtin.wait_for:
host: "{{ current_address }}"
host: "{{ item.address }}"
port: 22
search_regex: OpenSSH
timeout: 10
connection: local
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
loop_control:
label: "{{ current_address }}"
label: "{{ item.address }}"
- name: Check if Talos ports are reachable
when: (not ci_test | default(false)) and (bootstrap_distribution == "talos")
ansible.builtin.wait_for:
host: "{{ item.address }}"
port: 50000
timeout: 10
connection: local
loop: "{{ bootstrap_nodes.master + bootstrap_nodes.worker | default([]) }}"
loop_control:
label: "{{ item.address }}"
+1 -1
View File
@@ -33,7 +33,7 @@
- name: Check if bootstrap distribution is valid
ansible.builtin.assert:
that: bootstrap_distribution in ['k0s', 'k3s']
that: bootstrap_distribution in ['k0s', 'k3s', 'talos']
success_msg: Distribution {{ bootstrap_distribution }} is valid
fail_msg: Distribution {{ bootstrap_distribution }} is not valid