# Argument seems to be required even though it is not

**URL:** <https://forum.ansible.com/t/argument-seems-to-be-required-even-though-it-is-not/5980>\
**Category:** Get Help\
**Tags:** dev, playbook\
**Created:** [May 24, 2024, 9:26am UTC](https://forum.ansible.com/t/argument-seems-to-be-required-even-though-it-is-not/5980 "2024-05-24T09:26:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikuiz](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@nikuiz](https://forum.ansible.com/u/nikuiz)\
**Post date:** [May 24, 2024, 9:26am UTC](https://forum.ansible.com/t/argument-seems-to-be-required-even-though-it-is-not/5980/1 "2024-05-24T09:26:17Z")

</div>

Hello! I’m currently developing a custom module to support a specific network OS. This module takes some custom arguments. The problem is that even though some of them are not required, when running a playbook Ansible still sees it as an error and fails the task.

What did I do wrong here? It seems to be the case only for arguments with the option “choices”, as if they were automatically seen as required, altough this is not the functionning I’m looking for.

Thanks for your help!

My playbook :

```auto
    - name: Configure interfaces
      custom.ers.ers_interfaces:
        config:
          - interfaces: 10-14
            vlan: 100,200,300
            pvid: 100

```

My argument specs:

```auto
self._argument_spec = {
            "config": {
                "elements": "dict",
                "options": {
                    "interfaces": {"type": "str", "required": True},
                    "vlan": {"type": "str"},
                    "pvid": {"type": "str"},
                    "tagging": {"type": "str", "choices": ["untagall", "untagpvidonly", "tagall"]},
                    "shutdown": {"type": "str", "choices": ["enabled", "disabled"]},
                    "description": {"type": "str"}
                },
                "type": "list",
            }
        }

```

---

<div class="post-metadata">

**Author:** ![akira6592](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akira6592/32/222_2.png) [@akira6592](https://forum.ansible.com/u/akira6592)\
**Post date:** [May 24, 2024, 11:02am UTC](https://forum.ansible.com/t/argument-seems-to-be-required-even-though-it-is-not/5980/2 "2024-05-24T11:02:31Z")

</div>

@nikuiz Hello!

What error message did you get?

---

<div class="post-metadata">

**Author:** ![nikuiz](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@nikuiz](https://forum.ansible.com/u/nikuiz)\
**Post date:** [May 24, 2024, 11:48am UTC](https://forum.ansible.com/t/argument-seems-to-be-required-even-though-it-is-not/5980/3 "2024-05-24T11:48:39Z")

</div>

Sorry, I completely forgot to include the error message 😬

Here it is :

```auto
"msg": "value of tagging must be one of: untagall, untagpvidonly, tagall, got: None found in config"

```

or

```auto
"msg": "value of shutdown must be one of: enabled, disabled, got: None found in config"

```
