]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests/functional/setup: change mount options
authorDimitri Savineau <dsavinea@redhat.com>
Fri, 12 Apr 2019 14:46:20 +0000 (10:46 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 17 Apr 2019 06:23:07 +0000 (08:23 +0200)
In the CI jobs we can change the mount options of the main partition
to avoid extra operations on disk.
Adding jmespath to tests/requirements.txt due to the json_query
filter usage.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
tests/functional/setup.yml
tests/requirements.txt

index 52f8ebc5ce63516d4cd4cdb6d2acd429838ddd66..91eddb870f4c77dea85aaa498328ce9fde90257a 100644 (file)
       set_fact:
         is_atomic: '{{ stat_ostree.stat.exists }}'
 
+    - name: get root mount information
+      set_fact:
+        rootmount: "{{ ansible_mounts|json_query('[?mount==`/`]|[0]') }}"
+
+    # mount -o remount doesn't work on RHEL 8 for now
+    - name: add mount options to /
+      mount:
+        path: '{{ rootmount.mount }}'
+        src: '{{ rootmount.device }}'
+        opts: noatime,nodiratime,nobarrier
+        fstype: '{{ rootmount.fstype }}'
+        state: mounted
+      when: not (ansible_os_family == 'RedHat' and
+                 ansible_distribution_major_version == '8')
+
       # we need to install this so the Socket testinfra module
       # can use netcat for testing
     - name: install net-tools
index b246957470f135fd52965aca03bad8eaf5f49e2f..8f89d8073630a086a712e4d7e323b66ae23f04cf 100644 (file)
@@ -7,3 +7,4 @@ notario>=0.0.13
 ansible~=2.7,<2.8
 netaddr
 mock
+jmespath