Simply k3s setup by using a default ansible configuration

This commit is contained in:
2025-09-18 15:55:36 +02:00
parent 75a485fbff
commit f4bf7569a6
3 changed files with 11 additions and 7 deletions

View File

@@ -11,16 +11,12 @@ The setup requires a `inventory.ini` this should be provided by a previous step.
[source,bash] [source,bash]
---- ----
ansible-galaxy install -r requirements.yml # <1> ansible-galaxy install -r requirements.yml # <1>
ansible-playbook k3s.orchestration.site -i inventory.ini # <2> ansible-playbook site.yml # <2>
ansible-playbook download-kube-config.yml -i inventory.ini # <3>
ansible-playbook k3s.orchestration.upgrade -i inventory.ini # <4>
---- ----
<1> Install required ansible collections to create a k3s-cluster (can be omitted in subsequent runs) <1> Install required ansible collections to create a k3s-cluster (can be omitted in subsequent runs)
<2> Install k3s <2> Install k3s and download kube-config to .kube/config
<3> Download the kube-config to .kube/config
<4> Update k3s when necessary
[IMPORTANT] [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[] // end::setup[]

5
k3s/ansible.cfg Normal file
View File

@@ -0,0 +1,5 @@
[defaults]
nocows = True
inventory = inventory.ini
display_skipped_hosts = False
error_on_undefined_vars = True

3
k3s/main.yml Normal file
View File

@@ -0,0 +1,3 @@
- import_playbook: k3s.orchestration.site
- import_playbook: download-kube-config.yml
- import_playbook: k3s.orchestration.upgrade