From: Guillaume Abrioux Date: Fri, 1 Feb 2019 14:08:53 +0000 (+0100) Subject: facts: set timeout_command fact in ceph-defaults X-Git-Tag: v4.0.0beta1~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fdca29f2a732f500bcfb595cdbfb94141ece54cf;p=ceph-ansible.git facts: set timeout_command fact in ceph-defaults - also add `--foreground` which seems to fix some issue we are facing when using timeout with `podman`. - use this fact in the `is ceph running already?` task. Signed-off-by: Guillaume Abrioux --- diff --git a/roles/ceph-container-common/tasks/fetch_image.yml b/roles/ceph-container-common/tasks/fetch_image.yml index b0e4ef914..040a0f493 100644 --- a/roles/ceph-container-common/tasks/fetch_image.yml +++ b/roles/ceph-container-common/tasks/fetch_image.yml @@ -176,12 +176,6 @@ - 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_command }} {{ container_binary }} pull {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" changed_when: false diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 210499a08..58055c22f 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -544,7 +544,7 @@ ceph_docker_enable_centos_extra_repo: false ceph_docker_on_openstack: false containerized_deployment: False container_binary: - +timeout_command: "{{ 'timeout --foreground -s KILL ' ~ docker_pull_timeout if (docker_pull_timeout != '0') and (ceph_docker_dev_image is undefined or not ceph_docker_dev_image) else '' }}" # this is only here for usage with the rolling_update.yml playbook diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index cb223cc38..4da150627 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -51,7 +51,7 @@ # because it blindly picks a mon, which may be down because # of the rolling update - name: is ceph running already? - command: "timeout 5 {{ docker_exec_cmd }} ceph --cluster {{ cluster }} -s -f json" + command: "{{ timeout_command }} {{ docker_exec_cmd }} ceph --cluster {{ cluster }} -s -f json" changed_when: false failed_when: false check_mode: no