]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: do not install lvm2 on atomic host
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Oct 2018 20:45:05 +0000 (16:45 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 10 Oct 2018 20:08:41 +0000 (16:08 -0400)
we need to detect whether we are running on atomic host to not try to
install lvm2 package.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
tests/functional/lvm_setup.yml

index ef30614eb529eaa873c641f8b5823fb27adfa5af..c6908a4bedf2fbf5cb7e2038afb4b909945aa2df 100644 (file)
@@ -1,15 +1,30 @@
 ---
 
 - hosts: osds
-  gather_facts: true
+  gather_facts: false
   become: yes
   tasks:
 
+    - name: check if it is atomic host
+      stat:
+        path: /run/ostree-booted
+      register: stat_ostree
+      tags:
+        - always
+
+    - name: set_fact is_atomic
+      set_fact:
+        is_atomic: '{{ stat_ostree.stat.exists }}'
+      tags:
+        - always
+
     # Some images may not have lvm2 installed
     - name: install lvm2
       package:
         name: lvm2
         state: present
+      when:
+        - not is_atomic
 
     - name: create physical volume
       command: pvcreate /dev/sdb