diff --git a/.ostree/README.md b/.ostree/README.md new file mode 100644 index 00000000..f5e6931b --- /dev/null +++ b/.ostree/README.md @@ -0,0 +1,3 @@ +*NOTE*: The `*.txt` files are used by `get_ostree_data.sh` to create the lists +of packages, and to find other system roles used by this role. DO NOT use them +directly. diff --git a/.ostree/get_ostree_data.sh b/.ostree/get_ostree_data.sh new file mode 100755 index 00000000..7c325241 --- /dev/null +++ b/.ostree/get_ostree_data.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +set -euo pipefail + +role_collection_dir="${ROLE_COLLECTION_DIR:-fedora/linux_system_roles}" +ostree_dir="${OSTREE_DIR:-"$(dirname "$(realpath "$0")")"}" + +if [ -z "${4:-}" ] || [ "${1:-}" = help ] || [ "${1:-}" = -h ]; then + cat <')) + else ['util-linux'] if ansible_facts['os_family'] == 'RedHat' + else ['util-linux'] }}" + - name: Find unused disks in the system find_unused_disk: min_size: "{{ min_size | d(omit) }}" diff --git a/tests/test-verify-volume-mount.yml b/tests/test-verify-volume-mount.yml index 0a2dfe90..33913cd7 100644 --- a/tests/test-verify-volume-mount.yml +++ b/tests/test-verify-volume-mount.yml @@ -19,9 +19,9 @@ selectattr('device', 'match', '^' ~ storage_test_device_path ~ '$') | list }}" storage_test_mount_point_matches: "{{ ansible_mounts | - selectattr('mount', - 'match', '^' ~ storage_test_volume.mount_point ~ '$') | - list }}" + selectattr('mount', 'match', + '^' ~ mount_prefix ~ storage_test_volume.mount_point ~ '$') | + list if storage_test_volume.mount_point else [] }}" storage_test_mount_expected_match_count: "{{ 1 if _storage_test_volume_present and storage_test_volume.mount_point and storage_test_volume.mount_point.startswith('/') @@ -29,6 +29,12 @@ storage_test_swap_expected_matches: "{{ 1 if _storage_test_volume_present and storage_test_volume.fs_type == 'swap' else 0 }}" + vars: + # assumes /opt which is /var/opt in ostree + mount_prefix: "{{ '/var' + if ansible_facts.pkg_mgr == 'ansible.posix.rhel_rpm_ostree' + and storage_test_volume.mount_point + and storage_test_volume.mount_point.startswith('/opt') else '' }}" - name: Get information about the mountpoint directory stat: