From b02e58db767612790f7af76ef598b6680ec78db4 Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Sun, 23 Apr 2023 17:35:55 -0400 Subject: [PATCH] Fix the failure of running ANSIBLE_GATHERING=explicit on tests_switch_provider.yml The test `tests_switch_provider.yml` fails to run with `ANSIBLE_GATHERING=explicit` with the error described below. Therefore, include the task 'el_repo_setup.yml' before running the test which supports gathering the minimum subset of facts required. ``` TASK [set fact to use initscripts network_provider] task path: /tmp/tmp.Q6nP8W4iPS/rhel_system_roles/tests/network/playbooks/tests_switch_provider.yml:8 fatal: [/tmp/tmp.Q6nP8W4iPS/RHEL_8_8_TESTING.qcow2]: FAILED! => {} MSG: The conditional check 'ansible_distribution in ['CentOS', 'RedHat'] and ansible_distribution_major_version in ['7', '8']' failed. The error was: error while evaluating conditional (ansible_distribution in ['CentOS', 'RedHat'] and ansible_distribution_major_version in ['7', '8']): 'ansible_distribution' is undefined. ``` Signed-off-by: Wen Liang --- tests/tests_switch_provider.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/tests_switch_provider.yml b/tests/tests_switch_provider.yml index bbe1d5e..fd2ad7e 100644 --- a/tests/tests_switch_provider.yml +++ b/tests/tests_switch_provider.yml @@ -2,6 +2,9 @@ --- - hosts: all name: Run playbook 'playbooks/tests_switch_provider.yml' + tasks: + - name: Include the task 'el_repo_setup.yml' + include_tasks: tasks/el_repo_setup.yml - name: Import the playbook 'playbooks/tests_switch_provider.yml' import_playbook: playbooks/tests_switch_provider.yml