]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
facts: set timeout_command fact in ceph-defaults
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 1 Feb 2019 14:08:53 +0000 (15:08 +0100)
committerSébastien Han <seb@redhat.com>
Tue, 5 Feb 2019 17:14:28 +0000 (18:14 +0100)
- 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 <gabrioux@redhat.com>
roles/ceph-container-common/tasks/fetch_image.yml
roles/ceph-defaults/defaults/main.yml
roles/ceph-facts/tasks/facts.yml

index b0e4ef914b4f0c4ad502a86237b32626ba8cce19..040a0f493c2f0245b288a43f4727afdf2bf7792a 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_command }} {{ container_binary }} pull {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
   changed_when: false
index 210499a08d311713b6cbd958fa277675004f0a2a..58055c22f989038ff95f353251b9887101dc5e97 100644 (file)
@@ -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
index cb223cc38c412439bfcc66035e62f359459c2c83..4da1506270335137274c2ef9cea11c5302e69be7 100644 (file)
@@ -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