mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Integration tests: replace ansible_xxx with ansible_facts.xxx (#11479)
Replace ansible_xxx with ansible_facts.xxx.
This commit is contained in:
@@ -52,12 +52,12 @@
|
||||
|
||||
- set_fact:
|
||||
file_contents: "{{ get_file_content.stdout }}"
|
||||
when: ansible_distribution == 'RedHat' and ansible_distribution_version is version('7.9', '==')
|
||||
when: ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_version is version('7.9', '==')
|
||||
|
||||
- name: Get the content of file test02.cfg
|
||||
set_fact:
|
||||
file_contents: "{{ lookup('file', mount_root_dir + '/test02.cfg') }}"
|
||||
when: not (ansible_distribution == 'RedHat' and ansible_distribution_version is version('7.9', '=='))
|
||||
when: not (ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_version is version('7.9', '=='))
|
||||
|
||||
- fail: msg="Failed to replace the file test02.cfg"
|
||||
when: file_contents != "test"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
delete_files:
|
||||
- "test01.cfg"
|
||||
|
||||
- debug: var=ansible_distribution
|
||||
- debug: var=ansible_facts.distribution
|
||||
|
||||
- include_tasks: iso_mount.yml
|
||||
vars:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
- debug: var=ansible_distribution
|
||||
- debug: var=ansible_facts.distribution
|
||||
|
||||
- block:
|
||||
- name: "Mount customized ISO on MAC"
|
||||
@@ -20,7 +20,7 @@
|
||||
- set_fact:
|
||||
mount_root_dir: "{{ test_dir }}/iso_mount/CDROM"
|
||||
when: iso_name.find('udf') != -1
|
||||
when: ansible_distribution == "MacOSX"
|
||||
when: ansible_facts.distribution == "MacOSX"
|
||||
|
||||
- block:
|
||||
- name: "Mount {{ iso_name }} to {{ test_dir }}/iso_mount on localhost"
|
||||
@@ -36,4 +36,4 @@
|
||||
- set_fact:
|
||||
mount_root_dir: "{{ test_dir }}/iso_mount"
|
||||
when:
|
||||
- ansible_distribution != "MacOSX"
|
||||
- ansible_facts.distribution != "MacOSX"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
- name: Skip some platforms which does not support ansible.posix.mount
|
||||
meta: end_play
|
||||
when: ansible_distribution in ['Alpine']
|
||||
when: ansible_facts.distribution in ['Alpine']
|
||||
|
||||
- set_fact:
|
||||
test_dir: '{{ remote_tmp_dir }}/test_iso_customize'
|
||||
|
||||
Reference in New Issue
Block a user