is it possible to run import_playbook
with condition?
here is example from my ansible code
we want to run run_tasks_only_on_rhel8.yml
from import_playbook
when condition is only for rhel8 machines
- import_playbook: "{{playbook_folder}}/run_tasks_only_on_rhel8.yml"
when: ansible_facts['distribution_major_version'] == "8"
but from ansible playbook output we see the following errors
The conditional check 'ansible_facts['distribution_major_version'] == "8"' failed. The error was: error while evaluating conditional (ansible_facts['distribution_major_version'] == "8"): 'dict object' has no attribute 'distribution_major_version'
what need to correct here ?