]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
site-docker.yml try to fetch images in //
authorSébastien Han <seb@redhat.com>
Wed, 27 Sep 2017 22:11:53 +0000 (00:11 +0200)
committerSébastien Han <seb@redhat.com>
Fri, 13 Oct 2017 09:24:40 +0000 (11:24 +0200)
The container deployment is serialized, adding this task as a best
effort. If docker is already present we pull the image otherwise we wait
for the role to play.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-docker-common/tasks/main.yml
site-docker.yml.sample

index 48fc3a56c3141fa8f6cd836aa54013e613d9cd39..20e7d0ea62380d0d88463cca2b190d06096ab352 100644 (file)
@@ -12,6 +12,8 @@
 - name: set_fact is_atomic
   set_fact:
     is_atomic: '{{ stat_ostree.stat.exists }}'
+  tags:
+    - always
 
 - name: include pre_requisites/prerequisites.yml
   include: pre_requisites/prerequisites.yml
@@ -88,6 +90,8 @@
 
 - name: include fetch_image.yml
   include: fetch_image.yml
+  tags:
+    - fetch_container_image
 
 - name: get ceph version
   command: docker run --entrypoint /usr/bin/ceph {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --version
index 2a9b12cc3ac5994fb9e3a2d93e66725a5248de8b..548ea20a14e71d010cc2cc988908672466ca42fa 100644 (file)
   - clients
   - iscsigws
   - mgrs
-
   gather_facts: false
-
-  tasks:
+  become: True
+  pre_tasks:
     - name: gather and delegate facts
       setup:
       delegate_to: "{{ item }}"
       delegate_facts: True
       with_items: "{{ groups['all'] }}"
 
+    - name: check if it is atomic host
+      stat:
+        path: /run/ostree-booted
+      register: stat_ostree
+      tags:
+        - always
+
+    - name: set_fact is_atomic
+      set_fact:
+        atomic: '{{ stat_ostree.stat.exists }}'
+      tags:
+        - always
+
+  roles:
+    - { role: ceph-defaults,
+        tags: [with_pkg, fetch_container_image],
+        when: "(containerized_deployment | bool) and not (atomic | bool)" }
+    - { role: ceph-docker-common,
+        tags: [with_pkg, fetch_container_image],
+        when: "(containerized_deployment | bool) and not (atomic | bool)" }
+
+  post_tasks:
+    - name: "pull {{ ceph_docker_image }} image"
+      command: "docker pull {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
+      changed_when: false
+      when:
+        - atomic
+        - (ceph_docker_dev_image is undefined or not ceph_docker_dev_image)
+
 - hosts: mons
   become: True
   gather_facts: false