mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-09 11:47:47 +03:00
crio: avoid extra restart after install and upgrade (#6882)
Package upgrade restarts crio. By creating/updating config first, an extra restart can be avoided.
This commit is contained in:
@@ -58,6 +58,12 @@
|
|||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
- name: Install cri-o config
|
||||||
|
template:
|
||||||
|
src: crio.conf.j2
|
||||||
|
dest: /etc/crio/crio.conf
|
||||||
|
register: config_install
|
||||||
|
|
||||||
- name: Install cri-o packages
|
- name: Install cri-o packages
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
@@ -112,12 +118,6 @@
|
|||||||
- 100-crio-bridge.conf
|
- 100-crio-bridge.conf
|
||||||
- 200-loopback.conf
|
- 200-loopback.conf
|
||||||
|
|
||||||
- name: Install cri-o config
|
|
||||||
template:
|
|
||||||
src: crio.conf.j2
|
|
||||||
dest: /etc/crio/crio.conf
|
|
||||||
notify: restart crio
|
|
||||||
|
|
||||||
- name: Copy mounts.conf
|
- name: Copy mounts.conf
|
||||||
copy:
|
copy:
|
||||||
src: mounts.conf
|
src: mounts.conf
|
||||||
@@ -156,6 +156,16 @@
|
|||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
enabled: true
|
enabled: true
|
||||||
state: started
|
state: started
|
||||||
|
register: service_start
|
||||||
|
|
||||||
|
- name: Trigger service restart only when needed
|
||||||
|
service: # noqa 503
|
||||||
|
name: crio
|
||||||
|
state: restarted
|
||||||
|
when:
|
||||||
|
- config_install.changed
|
||||||
|
- not package_install.changed
|
||||||
|
- not service_start.changed
|
||||||
|
|
||||||
- name: Verify that crio is running
|
- name: Verify that crio is running
|
||||||
command: "crio-status info"
|
command: "crio-status info"
|
||||||
|
|||||||
Reference in New Issue
Block a user