diff --git a/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/README.md b/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/README.md index 519e53333..ea6e31921 100644 --- a/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/README.md +++ b/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/README.md @@ -7,14 +7,21 @@ For the details, please check this link: https://docs.k3s.io/ ## Using the role -### Deploying k3s +### Deploy ```yaml - include_role: name: k3s ``` -### Restarting k3s is needed after gets deployed +The role will: +- Configure `ingress_class` automatically to use traefik +- Install helm +- Deploy and restart k3s + +### (Optional) Restart + +There is a restart role that can be used if needed ```yaml - include_role: diff --git a/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/tasks/main.yml b/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/tasks/main.yml index 01070ee13..f8593377b 100644 --- a/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/tasks/main.yml +++ b/user-skel/ansible_collections/ace_box/ace_box/roles/k3s/tasks/main.yml @@ -1,3 +1,4 @@ + # Copyright 2024 Dynatrace LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -# Set ingress_class to traefik -# +################################ +# Set ingress_class to traefik # +################################ - include_role: name: config-v2 tasks_from: set-var @@ -47,11 +48,23 @@ src: /etc/rancher/k3s/k3s.yaml dest: /home/{{ ace_box_user }}/.kube/config -# Install helm via +################# +# Installs helm # +################# - name: Install Helm become: true become_user: root community.general.snap: name: - helm - classic: yes \ No newline at end of file + classic: yes + +############### +# Restart k3s # +############### +- name: k3s restart + become: true + become_user: root + ansible.builtin.service: + name: k3s + state: restarted