Hello Team,
I have spent a lot of time trying troubleshoot this issue.
I have a roles with defined variable
This is inside defaults/main.yml
nessus_agent_package:
- redhat7:
- al2: ./files/NessusAgent-8.3.1-amzn.x86_64.rpm
- al1:
and my tasks main.yml has an include which will identify the server and include an appropriate files inside
- name: include distribution specific install YAML files
include: “{{ ansible_distribution }}.yml”
Those files are present on tasks level
-rw-r–r–. 1 root root 740 Oct 5 20:49 Amazon.yml
-rw-r–r–. 1 root root 260 Oct 5 08:41 Debian.yml
-rw-r–r–. 1 root root 1024 Oct 5 07:39 main.yml
-rw-r–r–. 1 root root 1040 Oct 5 08:55 RedHat.yml
-rw-r–r–. 1 root root 1031 Oct 5 08:57 SUSE.yml
-rw-r–r–. 1 root root 260 Oct 5 08:02 Ubuntu.yml
Now I’m deploying the code inside an Amazon EC2 Linux 2 system which after gather the facts was routed to select Amazon.yml file.