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
6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

- name: Enable the Extras repository on RHEL 7
when:
- ansible_distribution == 'RedHat'
- ansible_distribution_major_version == '7'
- ansible_facts["distribution"] == 'RedHat'
- ansible_facts["distribution_major_version"] == '7'
- not __cockpit_is_ostree | d(false)
block:
- name: List active RHEL repositories
Expand All @@ -25,7 +25,7 @@
if applicable
include_tasks: "{{ item }}"
with_first_found:
- "setup-{{ ansible_pkg_mgr }}.yml"
- "setup-{{ ansible_facts['pkg_mgr'] }}.yml"
- "setup-default.yml"
when: not __cockpit_is_ostree | d(false)

Expand Down
8 changes: 4 additions & 4 deletions tasks/set_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
- name: Set version specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yml"
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yml"
- "{{ ansible_facts['distribution'] }}.yml"
- "{{ ansible_facts['os_family'] }}.yml"
- "default.yml"
14 changes: 7 additions & 7 deletions tests/tasks/install_selinux_tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use: "{{ (__cockpit_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
when:
- ansible_python_version is version('3', '<')
- ansible_distribution in ["Fedora", "CentOS", "RedHat", "Rocky"]
- ansible_facts["python_version"] is version('3', '<')
- ansible_facts["distribution"] in ["Fedora", "CentOS", "RedHat", "Rocky"]

- name: Install SELinux python3 tools
package:
Expand All @@ -33,8 +33,8 @@
use: "{{ (__cockpit_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
when:
- ansible_python_version is version('3', '>=')
- ansible_distribution in ["Fedora", "CentOS", "RedHat", "Rocky"]
- ansible_facts["python_version"] is version('3', '>=')
- ansible_facts["distribution"] in ["Fedora", "CentOS", "RedHat", "Rocky"]

- name: Install SELinux tool semanage
package:
Expand All @@ -43,6 +43,6 @@
state: present
use: "{{ (__cockpit_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
when: ansible_distribution == "Fedora" or
(ansible_distribution_major_version | int > 7 and
ansible_distribution in ["CentOS", "RedHat", "Rocky"])
when: ansible_facts["distribution"] == "Fedora" or
(ansible_facts["distribution_major_version"] | int > 7 and
ansible_facts["distribution"] in ["CentOS", "RedHat", "Rocky"])
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 @@ __cockpit_rh_distros:
__cockpit_rh_distros_fedora: "{{ __cockpit_rh_distros + ['Fedora'] }}"

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

# Use this in conditionals to check if distro is Red Hat or clone, or Fedora
__cockpit_is_rh_distro_fedora: "{{ ansible_distribution in __cockpit_rh_distros_fedora }}"
__cockpit_is_rh_distro_fedora: "{{ ansible_facts['distribution'] in __cockpit_rh_distros_fedora }}"
4 changes: 2 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ __cockpit_rh_distros:
__cockpit_rh_distros_fedora: "{{ __cockpit_rh_distros + ['Fedora'] }}"

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

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