# the task includes an option with an undefined variable. The error was: 'dict object' has no attribute

**URL:** <https://forum.ansible.com/t/the-task-includes-an-option-with-an-undefined-variable-the-error-was-dict-object-has-no-attribute/35876>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 15, 2021, 12:35am UTC](https://forum.ansible.com/t/the-task-includes-an-option-with-an-undefined-variable-the-error-was-dict-object-has-no-attribute/35876 "2021-10-15T00:35:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bariou\_Alarou](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Bariou\_Alarou](https://forum.ansible.com/u/Bariou_Alarou)\
**Post date:** [October 15, 2021, 12:35am UTC](https://forum.ansible.com/t/the-task-includes-an-option-with-an-undefined-variable-the-error-was-dict-object-has-no-attribute/35876/1 "2021-10-15T00:35:54Z")

</div>

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.
