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:
parent
fefcb8c9f8
commit
fc22453618
1 changed files with 16 additions and 6 deletions
|
@ -58,6 +58,12 @@
|
|||
path: "{{ item }}"
|
||||
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
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
|
@ -112,12 +118,6 @@
|
|||
- 100-crio-bridge.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
|
||||
copy:
|
||||
src: mounts.conf
|
||||
|
@ -156,6 +156,16 @@
|
|||
daemon_reload: true
|
||||
enabled: true
|
||||
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
|
||||
command: "crio-status info"
|
||||
|
|
Loading…
Reference in a new issue