Move k3s systemd service from handler to task

This commit is contained in:
Khue Doan 2021-09-01 16:26:10 +07:00
parent dc80ff21f9
commit e028ca7bc2
2 changed files with 9 additions and 7 deletions

View File

@ -1,6 +0,0 @@
- name: Restart k3s service
systemd:
name: k3s
daemon_reload: yes
enabled: yes
state: restarted

View File

@ -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