40 lines
914 B
YAML
40 lines
914 B
YAML
|
---
|
||
|
|
||
|
- name: Reload systemd
|
||
|
ansible.builtin.systemd:
|
||
|
daemon_reload: true
|
||
|
scope: "{{ k3s_systemd_context }}"
|
||
|
become: "{{ k3s_become }}"
|
||
|
|
||
|
- name: Reload service
|
||
|
ansible.builtin.set_fact:
|
||
|
k3s_service_reloaded: true
|
||
|
become: "{{ k3s_become }}"
|
||
|
|
||
|
- name: Restart k3s systemd
|
||
|
ansible.builtin.systemd:
|
||
|
name: k3s
|
||
|
state: restarted
|
||
|
scope: "{{ k3s_systemd_context }}"
|
||
|
enabled: "{{ k3s_start_on_boot }}"
|
||
|
retries: 3
|
||
|
delay: 3
|
||
|
register: k3s_systemd_restart_k3s
|
||
|
failed_when:
|
||
|
- k3s_systemd_restart_k3s is not success
|
||
|
- not ansible_check_mode
|
||
|
become: "{{ k3s_become }}"
|
||
|
|
||
|
- name: Restart k3s service
|
||
|
ansible.builtin.service:
|
||
|
name: k3s
|
||
|
state: restarted
|
||
|
enabled: "{{ k3s_start_on_boot }}"
|
||
|
retries: 3
|
||
|
delay: 3
|
||
|
register: k3s_service_restart_k3s
|
||
|
failed_when:
|
||
|
- k3s_service_restart_k3s is not success
|
||
|
- not ansible_check_mode
|
||
|
become: "{{ k3s_become }}"
|