crio: avoid extra restart after install and upgrade (#6882)

Package upgrade restarts crio. By creating/updating config first,
an extra restart can be avoided.
pull/6244/head
Hans Feldt 2020-11-03 17:54:03 +01:00 committed by GitHub
parent fefcb8c9f8
commit fc22453618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 6 deletions

View File

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