]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
facts: isolate is_atomic task
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 27 Feb 2020 13:08:02 +0000 (14:08 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 27 Feb 2020 13:09:56 +0000 (14:09 +0100)
This commit isolates the task setting the fact `is_atomic`.
So we can call ceph-facts with `tasks_from` when we only need this fact.
This avoid having to run the whole role just for this.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-facts/tasks/facts.yml
roles/ceph-facts/tasks/is_atomic.yml [new file with mode: 0644]

index fdfc4f130de10f53c11aeedd9b0cd7d8a57267b3..78a475eb119b8722bcf788aa215fd97f248ae732 100644 (file)
@@ -1,12 +1,6 @@
 ---
-- name: check if it is atomic host
-  stat:
-    path: /run/ostree-booted
-  register: stat_ostree
-
-- name: set_fact is_atomic
-  set_fact:
-    is_atomic: "{{ stat_ostree.stat.exists }}"
+- name: import_tasks is_atomic.yml
+  import_tasks: is_atomic.yml
 
 - name: import_tasks container_binary.yml
   import_tasks: container_binary.yml
diff --git a/roles/ceph-facts/tasks/is_atomic.yml b/roles/ceph-facts/tasks/is_atomic.yml
new file mode 100644 (file)
index 0000000..b287b73
--- /dev/null
@@ -0,0 +1,9 @@
+---
+- name: check if it is atomic host
+  stat:
+    path: /run/ostree-booted
+  register: stat_ostree
+
+- name: set_fact is_atomic
+  set_fact:
+    is_atomic: "{{ stat_ostree.stat.exists }}"
\ No newline at end of file