From cba9b23363b04895dbf0349429d8fd0af5cbadf0 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Wed, 30 Jan 2019 15:06:55 -0500 Subject: [PATCH] Do not timeout podman/docker pull if timeout value is '0' If user sets "docker_pull_timeout: '0'" then do not use the timeout command when running podman/docker pull. Also, use "timeout -s KILL"; without KILL, podman on RHEL8 beta does not timeout and deployment can hang. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1670625 Signed-off-by: John Fulton --- roles/ceph-container-common/tasks/fetch_image.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/ceph-container-common/tasks/fetch_image.yml b/roles/ceph-container-common/tasks/fetch_image.yml index 30c69289b..b0e4ef914 100644 --- a/roles/ceph-container-common/tasks/fetch_image.yml +++ b/roles/ceph-container-common/tasks/fetch_image.yml @@ -176,8 +176,14 @@ - nfs_group_name in group_names - ceph_nfs_container_inspect_before_pull.get('rc') == 0 +- name: set_fact timeout_command + set_fact: + timeout_command: "{{ 'timeout -s KILL ' ~ docker_pull_timeout if (docker_pull_timeout != '0') else '' }}" + when: + - (ceph_docker_dev_image is undefined or not ceph_docker_dev_image) + - name: "pulling {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} image" - command: "timeout {{ docker_pull_timeout }} {{ container_binary }} pull {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" + command: "{{ timeout_command }} {{ container_binary }} pull {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" changed_when: false register: docker_image until: docker_image.rc == 0