# The error was: KeyError: 'optional'

**URL:** <https://forum.ansible.com/t/the-error-was-keyerror-optional/36506>\
**Category:** Ansible Project\
**Created:** [April 4, 2022, 4:32pm UTC](https://forum.ansible.com/t/the-error-was-keyerror-optional/36506 "2022-04-04T16:32:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delmiro\_Campelo](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@Delmiro\_Campelo](https://forum.ansible.com/u/Delmiro_Campelo)\
**Post date:** [April 4, 2022, 4:32pm UTC](https://forum.ansible.com/t/the-error-was-keyerror-optional/36506/1 "2022-04-04T16:32:51Z")

</div>

Hello everyone, I’m writing here to see if you can help me with this issue. I have been trying to solve it for a while without any luck. The problem is with section of variables in the vmanage\_device\_attachment module. To make sure I had all the variables names correctly, I ran vmanage\_device\_template\_facts. The playbook runs fine when I remove all the variable names that start with “vedgePolicy/” as soon as I add those variables back, I get this error "The error was: KeyError: ‘optional’. I tried to use backslash “vedgePolicy/” to escape the forward slash but that didn’t know. Do you have any suggestions to solve this issue? I appreciate any input, as I have been trying to fix this for a while with no luck yet. thank you.

Please see more details about the issue in the github link below.

[https://github.com/CiscoDevNet/python-viptela/issues/162](https://github.com/CiscoDevNet/python-viptela/issues/162)
