1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

Integration tests: replace ansible_xxx with ansible_facts.xxx (#11479)

Replace ansible_xxx with ansible_facts.xxx.
This commit is contained in:
Felix Fontein 2026-02-07 18:18:48 +01:00 committed by GitHub
parent 106817316d
commit 476f2bf641
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
144 changed files with 548 additions and 578 deletions

View file

@ -11,21 +11,21 @@
# java >= 17 is not available in RHEL and CentOS7 repos, which is required for sdkmanager to run
- name: Bail out if not supported
when:
- "ansible_os_family == 'RedHat' and ansible_distribution_version is version('8.0', '<')"
- "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version is version('8.0', '<')"
ansible.builtin.meta: end_play
- name: Run android_sdk tests
environment:
PATH: '{{ ansible_env.PATH }}:{{ android_sdk_location }}/cmdline-tools/latest/bin'
PATH: '{{ ansible_facts.env.PATH }}:{{ android_sdk_location }}/cmdline-tools/latest/bin'
block:
- import_tasks: setup.yml
- name: Run default tests
import_tasks: default-tests.yml
when: ansible_os_family != 'FreeBSD'
when: ansible_facts.os_family != 'FreeBSD'
# Most of the important Android SDK packages are not available on FreeBSD (like, build-tools, platform-tools and so on),
# but at least some of the functionality can be tested (like, downloading sources)
- name: Run FreeBSD tests
import_tasks: freebsd-tests.yml
when: ansible_os_family == 'FreeBSD'
when: ansible_facts.os_family == 'FreeBSD'

View file

@ -13,10 +13,10 @@
vars:
params:
files:
- '{{ 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'
paths:
- '{{ role_path }}/vars'
@ -27,7 +27,7 @@
- "{{ openjdk_pkg }}"
- unzip
state: present
when: ansible_os_family != 'Darwin'
when: ansible_facts.os_family != 'Darwin'
- name: Install dependencies (OSX)
block:
@ -56,7 +56,7 @@
dest: "/Library/Java/JavaVirtualMachines/openjdk-17.jdk"
state: link
when:
- ansible_os_family == 'Darwin'
- ansible_facts.os_family == 'Darwin'
- name: Create Android SDK directory
file: