From f4bf7569a65cd1c7b56a851ee5b3ac70b761117c Mon Sep 17 00:00:00 2001 From: Felix Nehrke Date: Thu, 18 Sep 2025 15:55:36 +0200 Subject: [PATCH] Simply k3s setup by using a default ansible configuration --- k3s/README.adoc | 10 +++------- k3s/ansible.cfg | 5 +++++ k3s/main.yml | 3 +++ 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 k3s/ansible.cfg create mode 100644 k3s/main.yml diff --git a/k3s/README.adoc b/k3s/README.adoc index 512a78e..fcbd1be 100644 --- a/k3s/README.adoc +++ b/k3s/README.adoc @@ -11,16 +11,12 @@ The setup requires a `inventory.ini` this should be provided by a previous step. [source,bash] ---- ansible-galaxy install -r requirements.yml # <1> -ansible-playbook k3s.orchestration.site -i inventory.ini # <2> -ansible-playbook download-kube-config.yml -i inventory.ini # <3> -ansible-playbook k3s.orchestration.upgrade -i inventory.ini # <4> +ansible-playbook site.yml # <2> ---- <1> Install required ansible collections to create a k3s-cluster (can be omitted in subsequent runs) -<2> Install k3s -<3> Download the kube-config to .kube/config -<4> Update k3s when necessary +<2> Install k3s and download kube-config to .kube/config [IMPORTANT] -Step 3 will override any existing kube config this might destroy any existing settings! +The second step will override any existing kube config, this might destroy any existing settings! // end::setup[] diff --git a/k3s/ansible.cfg b/k3s/ansible.cfg new file mode 100644 index 0000000..5a2e71d --- /dev/null +++ b/k3s/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +nocows = True +inventory = inventory.ini +display_skipped_hosts = False +error_on_undefined_vars = True diff --git a/k3s/main.yml b/k3s/main.yml new file mode 100644 index 0000000..083368c --- /dev/null +++ b/k3s/main.yml @@ -0,0 +1,3 @@ +- import_playbook: k3s.orchestration.site +- import_playbook: download-kube-config.yml +- import_playbook: k3s.orchestration.upgrade