]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Do not timeout podman/docker pull if timeout value is '0'
authorJohn Fulton <fulton@redhat.com>
Wed, 30 Jan 2019 20:06:55 +0000 (15:06 -0500)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Thu, 31 Jan 2019 15:35:09 +0000 (15:35 +0000)
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 <fulton@redhat.com>
roles/ceph-container-common/tasks/fetch_image.yml

index 30c69289bd65cebeaf4951a4e9832600251c8910..b0e4ef914b4f0c4ad502a86237b32626ba8cce19 100644 (file)
     - 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