Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654 Change-Id: I5a83a7f237e4b7d86e8d7ee08b0e8c6b4f8a44f8
This commit is contained in:
parent
483b10e5e9
commit
e5cc6f8990
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
# EPEL repo is required for s3fs package. It won't be added in case s3fs is not required.
|
# EPEL repo is required for s3fs package. It won't be added in case s3fs is not required.
|
||||||
systemd_centos_epel_mirror: "{{ centos_epel_mirror | default('http://download.fedoraproject.org/pub/epel') }}"
|
systemd_centos_epel_mirror: "{{ centos_epel_mirror | default('http://download.fedoraproject.org/pub/epel') }}"
|
||||||
systemd_centos_epel_key: "{{ centos_epel_key | default('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-' ~ ansible_distribution_major_version) }}"
|
systemd_centos_epel_key: "{{ centos_epel_key | default('http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-' ~ ansible_facts['distribution_major_version']) }}"
|
||||||
|
|
||||||
# Any optioned required to make the mount point work. If no options are
|
# Any optioned required to make the mount point work. If no options are
|
||||||
# provided the default will be used. This list is comma separted.
|
# provided the default will be used. This list is comma separted.
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
- name: Gather variables for each operating system
|
- name: Gather variables for each operating system
|
||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
|
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
|
||||||
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
|
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
|
||||||
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
|
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
|
||||||
- "{{ ansible_distribution | lower }}.yml"
|
- "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||||
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_version.split('.')[0] }}.yml"
|
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_version'].split('.')[0] }}.yml"
|
||||||
- "{{ ansible_os_family | lower }}.yml"
|
- "{{ ansible_facts['os_family'] | lower }}.yml"
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
- name: Install EPEL
|
- name: Install EPEL
|
||||||
when:
|
when:
|
||||||
- "'s3fs' in systemd_mount_types"
|
- "'s3fs' in systemd_mount_types"
|
||||||
- ansible_os_family | lower == 'redhat'
|
- ansible_facts['os_family'] | lower == 'redhat'
|
||||||
block:
|
block:
|
||||||
- name: Download EPEL gpg keys
|
- name: Download EPEL gpg keys
|
||||||
get_url:
|
get_url:
|
||||||
@ -35,8 +35,8 @@
|
|||||||
- name: Install the EPEL repository
|
- name: Install the EPEL repository
|
||||||
yum_repository:
|
yum_repository:
|
||||||
name: epel-systemd_mounts
|
name: epel-systemd_mounts
|
||||||
baseurl: "{{ systemd_centos_epel_mirror ~ '/' ~ ansible_distribution_major_version ~ (ansible_distribution_major_version is version('8', '>=')) | ternary('/Everything/', '/') ~ ansible_architecture }}"
|
baseurl: "{{ systemd_centos_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ (ansible_facts['distribution_major_version'] is version('8', '>=')) | ternary('/Everything/', '/') ~ ansible_facts['architecture'] }}"
|
||||||
description: 'Extra Packages for Enterprise Linux {{ ansible_distribution_major_version }} - $basearch'
|
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
|
||||||
gpgcheck: yes
|
gpgcheck: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: present
|
state: present
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Install NFS packages
|
- name: Install NFS packages
|
||||||
package:
|
package:
|
||||||
name: "{{ nfs_package[ansible_distribution.split()[0] | lower] }}"
|
name: "{{ nfs_package[ansible_facts['distribution'].split()[0] | lower] }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: create the system group for nfs
|
- name: create the system group for nfs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user