Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tasks/enable_copr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
- name: Get list of COPRs
shell: |
set -euo pipefail
{{ ansible_pkg_mgr }} repolist | \
{{ ansible_facts['pkg_mgr'] }} repolist | \
grep -c `echo {{ repo.repository }} | tr / :` || true
register: copr_present
changed_when: false

- name: Enable COPRs
command:
cmd: "{{ ansible_pkg_mgr }} -y copr enable {{ repo.repository }}"
cmd: "{{ ansible_facts['pkg_mgr'] }} -y copr enable {{ repo.repository }}"
when: copr_present.stdout == "0"
changed_when: true
4 changes: 2 additions & 2 deletions tests/test-verify-pool-members.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Set test variables
set_fact:
_storage_test_pool_pvs_lvm: "{{ ansible_lvm.pvs | dict2items |
_storage_test_pool_pvs_lvm: "{{ ansible_facts['lvm'].pvs | dict2items |
selectattr('value.vg', 'match', '^' ~ storage_test_pool.name ~ '$') |
map(attribute='key') | list }}"
_storage_test_expected_pv_count: "{{ 0
Expand Down Expand Up @@ -79,7 +79,7 @@
scripts/does_library_support.py
blivet.formats.lvmpv.LVMPhysicalVolume.grow_to_fill
args:
executable: "{{ ansible_python.executable }}"
executable: "{{ ansible_facts['python'].executable }}"
register: grow_supported
changed_when: false
failed_when: grow_supported.rc not in [0, 1]
Expand Down
2 changes: 1 addition & 1 deletion tests/test-verify-volume-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

- name: Get the size of parent/pool device
bsize:
size: "{{ ansible_lvm.vgs[storage_test_pool.name].size_g + 'G' }}"
size: "{{ ansible_facts['lvm'].vgs[storage_test_pool.name].size_g + 'G' }}"
register: storage_test_pool_size
when:
- _storage_test_volume_present | bool
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_change_disk_fs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
mount_location: '/opt/test'
volume_size: '5g'
fs_type_after: "{{ 'ext3'
if (ansible_distribution == 'RedHat' and
ansible_distribution_major_version == '6')
if (ansible_facts['distribution'] == 'RedHat' and
ansible_facts['distribution_major_version'] == '6')
else 'ext4' }}"
tasks:
- name: Run the role
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_change_fs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
storage_safe_mode: false
mount_location: '/opt/test1'
volume_size: '5g'
fs_after: "{{ (ansible_distribution == 'RedHat' and
ansible_distribution_major_version == '6') |
fs_after: "{{ (ansible_facts['distribution'] == 'RedHat' and
ansible_facts['distribution_major_version'] == '6') |
ternary('ext4', 'xfs') }}"
tags:
- tests::lvm
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_change_fs_use_partitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
mount_location: '/opt/test1'
volume_size: '5g'
fs_type_after: "{{ 'ext3'
if (ansible_distribution == 'RedHat' and
ansible_distribution_major_version == '6')
if (ansible_facts['distribution'] == 'RedHat' and
ansible_facts['distribution_major_version'] == '6')
else 'ext4' }}"
tags:
- tests::lvm
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_create_lv_size_equal_to_vg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
mount_location: '/opt/test1'
volume_group_size: '10g'
lv_size: '10g'
unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}'
unused_disk_subfact: '{{ ansible_facts["devices"][unused_disks[0]] }}'
disk_size: '{{ unused_disk_subfact.sectors | int * 512 }}'
tags:
- tests::lvm
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_create_thinp_then_remove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
mount_location3: '/opt/test3'
volume1_size: '3g'
volume2_size: '4g'
fs_after: "{{ (ansible_distribution == 'RedHat' and
ansible_distribution_major_version == '6') |
fs_after: "{{ (ansible_facts['distribution'] == 'RedHat' and
ansible_facts['distribution_major_version'] == '6') |
ternary('ext4', 'xfs') }}"

tasks:
Expand Down
8 changes: 4 additions & 4 deletions tests/tests_include_vars_from_parent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
# create all variants like CentOS, CentOS_8.1, CentOS-8.1,
# CentOS-8, CentOS-8.1
# more formally:
# {{ ansible_distribution }}-{{ ansible_distribution_version }}
# {{ ansible_distribution }}-{{ ansible_distribution_major_version }}
# {{ ansible_distribution }}
# {{ ansible_os_family }}
# {{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}
# {{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}
# {{ ansible_facts['distribution'] }}
# {{ ansible_facts['os_family'] }}
# and the same for _ as separator.
varfiles: "{{ [facts['distribution']] | product(separators) |
map('join') | product(versions) | map('join') | list +
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_lvm_errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
invalid_disks:
- '/non/existent/disk'
invalid_size: 'xyz GiB'
unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}'
unused_disk_subfact: '{{ ansible_facts["devices"][unused_disks[0]] }}'
tags:
- tests::lvm
tasks:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
mount_location: /opt/test1
volume_group_size: "5g"
volume1_size: "4g"
unused_disk_subfact: "{{ ansible_devices[unused_disks[0]] }}"
unused_disk_subfact: "{{ ansible_facts['devices'][unused_disks[0]] }}"
too_large_size: "{{ (unused_disk_subfact.sectors | int * 1.2) * 512 }}"
tags:
- tests::lvm
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_resize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
volume_size_after: '9g'
invalid_size1: xyz GiB
invalid_size2: none
unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}'
unused_disk_subfact: '{{ ansible_facts["devices"][unused_disks[0]] }}'
too_large_size: '{{ unused_disk_subfact.sectors | int * 1.2 * 512 }}'
acc_large_size: '{{ unused_disk_subfact.sectors | int * 1.015 * 512 }}'
acc_small_size: '{{ unused_disk_subfact.sectors | int * 0.985 * 512 }}'
Expand Down
4 changes: 2 additions & 2 deletions tests/vars/rh_distros_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ __storage_rh_distros:
__storage_rh_distros_fedora: "{{ __storage_rh_distros + ['Fedora'] }}"

# Use this in conditionals to check if distro is Red Hat or clone
__storage_is_rh_distro: "{{ ansible_distribution in __storage_rh_distros }}"
__storage_is_rh_distro: "{{ ansible_facts['distribution'] in __storage_rh_distros }}"

# Use this in conditionals to check if distro is Red Hat or clone, or Fedora
__storage_is_rh_distro_fedora: "{{ ansible_distribution in __storage_rh_distros_fedora }}"
__storage_is_rh_distro_fedora: "{{ ansible_facts['distribution'] in __storage_rh_distros_fedora }}"
2 changes: 1 addition & 1 deletion tests/verify-pool-stratis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
scripts/stratis_pool_info.py
"{{ storage_test_pool.name }}"
args:
executable: "{{ ansible_python.executable }}"
executable: "{{ ansible_facts['python'].executable }}"
register: storage_test_stratis_report
changed_when: false

Expand Down
2 changes: 1 addition & 1 deletion vars/Fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ blivet_package_list:
- stratis-cli
# XXX libblockdev-s390 is available only on s390 so just add 'libblockdev' everywhere
# else, it is already brought in as dependency of blivet so it's just no-op here
- "{{ 'libblockdev-s390' if ansible_architecture == 's390x' else 'libblockdev' }}"
- "{{ 'libblockdev-s390' if ansible_facts['architecture'] == 's390x' else 'libblockdev' }}"
- vdo
_storage_copr_support_packages:
- dnf-plugins-core
2 changes: 1 addition & 1 deletion vars/OracleLinux_9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ blivet_package_list:
- stratis-cli
# XXX libblockdev-s390 is available only on s390 so just add 'libblockdev' everywhere
# else, it is already brought in as dependency of blivet so it's just no-op here
- "{{ 'libblockdev-s390' if ansible_architecture == 's390x' else 'libblockdev' }}"
- "{{ 'libblockdev-s390' if ansible_facts['architecture'] == 's390x' else 'libblockdev' }}"
2 changes: 1 addition & 1 deletion vars/RedHat_10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ blivet_package_list:
- stratis-cli
# XXX libblockdev-s390 is available only on s390 so just add 'libblockdev' everywhere
# else, it is already brought in as dependency of blivet so it's just no-op here
- "{{ 'libblockdev-s390' if ansible_architecture == 's390x' else 'libblockdev' }}"
- "{{ 'libblockdev-s390' if ansible_facts['architecture'] == 's390x' else 'libblockdev' }}"
- vdo
2 changes: 1 addition & 1 deletion vars/RedHat_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ blivet_package_list:
- libblockdev-swap
# XXX libblockdev-s390 is available only on s390 so just add 'libblockdev' everywhere
# else, it is already brought in as dependency of blivet so it's just no-op here
- "{{ 'libblockdev-s390' if ansible_architecture == 's390x' else 'libblockdev' }}"
- "{{ 'libblockdev-s390' if ansible_facts['architecture'] == 's390x' else 'libblockdev' }}"
# additional options for mkfs when creating a disk volume (whole disk fs)
__storage_blivet_diskvolume_mkfs_option_map:
ext2: '-F'
Expand Down
2 changes: 1 addition & 1 deletion vars/RedHat_8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ blivet_package_list:
- stratis-cli
# XXX libblockdev-s390 is available only on s390 so just add 'libblockdev' everywhere
# else, it is already brought in as dependency of blivet so it's just no-op here
- "{{ 'libblockdev-s390' if ansible_architecture == 's390x' else 'libblockdev' }}"
- "{{ 'libblockdev-s390' if ansible_facts['architecture'] == 's390x' else 'libblockdev' }}"
2 changes: 1 addition & 1 deletion vars/RedHat_9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ blivet_package_list:
- stratis-cli
# XXX libblockdev-s390 is available only on s390 so just add 'libblockdev' everywhere
# else, it is already brought in as dependency of blivet so it's just no-op here
- "{{ 'libblockdev-s390' if ansible_architecture == 's390x' else 'libblockdev' }}"
- "{{ 'libblockdev-s390' if ansible_facts['architecture'] == 's390x' else 'libblockdev' }}"
5 changes: 3 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __storage_required_facts:
- distribution_major_version
- distribution_version
- os_family
- pkg_mgr

# the subsets of ansible_facts that need to be gathered in case any of the
# facts in required_facts is missing; see the documentation of
Expand All @@ -29,8 +30,8 @@ __storage_rh_distros:
__storage_rh_distros_fedora: "{{ __storage_rh_distros + ['Fedora'] }}"

# Use this in conditionals to check if distro is Red Hat or clone
__storage_is_rh_distro: "{{ ansible_distribution in __storage_rh_distros }}"
__storage_is_rh_distro: "{{ ansible_facts['distribution'] in __storage_rh_distros }}"

# Use this in conditionals to check if distro is Red Hat or clone, or Fedora
__storage_is_rh_distro_fedora: "{{ ansible_distribution in __storage_rh_distros_fedora }}"
__storage_is_rh_distro_fedora: "{{ ansible_facts['distribution'] in __storage_rh_distros_fedora }}"
# END - DO NOT EDIT THIS BLOCK - rh distros variables
Loading