ansible-role-k3s/handlers/main.yml

33 lines
918 B
YAML
Raw Normal View History

2019-03-09 21:54:44 +01:00
---
- name: reload systemd
ansible.builtin.systemd:
daemon_reload: true
scope: "{{ k3s_systemd_context }}"
become: "{{ k3s_become_for_systemd | ternary(true, false, k3s_become_for_all) }}"
2019-03-09 21:54:44 +01:00
- name: restart k3s
ansible.builtin.systemd:
2019-03-09 21:54:44 +01:00
name: k3s
state: restarted
scope: "{{ k3s_systemd_context }}"
enabled: "{{ k3s_start_on_boot }}"
2020-11-11 09:41:26 +01:00
retries: 3
2020-11-11 15:47:29 +01:00
delay: 3
register: k3s_systemd_restart_k3s
failed_when:
- k3s_systemd_restart_k3s is not success
- not ansible_check_mode
become: "{{ k3s_become_for_systemd | ternary(true, false, k3s_become_for_all) }}"
2019-03-09 21:54:44 +01:00
- name: restart docker
ansible.builtin.systemd:
2019-03-09 21:54:44 +01:00
name: docker
state: restarted
enabled: true
register: k3s_systemd_restart_docker
failed_when:
- k3s_systemd_restart_docker is not success
- not ansible_check_mode
become: "{{ k3s_become_for_systemd | ternary(true, false, k3s_become_for_all) }}"