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
9 changes: 8 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
msg: >-
This role does not support s390x architecture.
Let us know if you need the role to support it.
when: ansible_architecture == 's390x'
when: ansible_facts['architecture'] == 's390x'

# null is allowed as a value for state: absent - but it is not needed
# and should not be used
Expand Down Expand Up @@ -160,3 +160,10 @@
- name: Collect bootloader facts
bootloader_facts:
when: bootloader_gather_facts | bool

# With Ansible 2.20, creating variables from facts is deprecated.
# This task is a workaround to set the bootloader_facts variable.
- name: Set bootloader_facts variable
set_fact:
bootloader_facts: "{{ ansible_facts['bootloader_facts'] }}"
when: bootloader_gather_facts | bool
2 changes: 1 addition & 1 deletion tests/tasks/skip_on_s390x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
when: '"architecture" not in ansible_facts.keys() | list'

- name: End host on s390x architecture
when: ansible_architecture == 's390x'
when: ansible_facts['architecture'] == 's390x'
meta: end_host
10 changes: 5 additions & 5 deletions tests/tests_include_vars_from_parent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
# 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
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 @@ __bootloader_rh_distros:
__bootloader_rh_distros_fedora: "{{ __bootloader_rh_distros + ['Fedora'] }}"

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

# Use this in conditionals to check if distro is Red Hat or clone, or Fedora
__bootloader_is_rh_distro_fedora: "{{ ansible_distribution in __bootloader_rh_distros_fedora }}"
__bootloader_is_rh_distro_fedora: "{{ ansible_facts['distribution'] in __bootloader_rh_distros_fedora }}"
10 changes: 5 additions & 5 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ __bootloader_packages:
- grubby
__bootloader_default_grub: /etc/default/grub
__bootloader_uefi_conf_dir: >-
{%- if ansible_os_family == 'RedHat' -%}
/boot/efi/EFI/{{ ansible_distribution | lower }}/
{%- elif ansible_os_family == 'Suse' -%}
{%- if ansible_facts['os_family'] == 'RedHat' -%}
/boot/efi/EFI/{{ ansible_facts['distribution'] | lower }}/
{%- elif ansible_facts['os_family'] == 'Suse' -%}
/boot/efi/EFI/BOOT/
{%- endif -%}
__bootloader_bios_conf_dir: /boot/grub2/
Expand All @@ -35,8 +35,8 @@ __bootloader_rh_distros:
__bootloader_rh_distros_fedora: "{{ __bootloader_rh_distros + ['Fedora'] }}"

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

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