diff --git a/metal/roles/k3s/handlers/main.yml b/metal/roles/k3s/handlers/main.yml deleted file mode 100644 index 8491971c..00000000 --- a/metal/roles/k3s/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Restart k3s service - systemd: - name: k3s - daemon_reload: yes - enabled: yes - state: restarted diff --git a/metal/roles/k3s/tasks/main.yml b/metal/roles/k3s/tasks/main.yml index 48e5fd79..7fca1a49 100644 --- a/metal/roles/k3s/tasks/main.yml +++ b/metal/roles/k3s/tasks/main.yml @@ -48,7 +48,15 @@ dest: "{{ k3s_config_file }}" - src: k3s.service.j2 dest: "{{ k3s_service_file }}" - notify: Restart k3s service + +- name: Enable k3s service + systemd: + name: k3s + enabled: yes + state: started + register: k3s_service + until: k3s_service is succeeded + retries: 5 - name: Get Kubernetes config file run_once: yes