# default value vs default value defined by user

**URL:** <https://forum.ansible.com/t/default-value-vs-default-value-defined-by-user/25073>\
**Category:** Ansible Developer\
**Created:** [July 24, 2017, 10:21pm UTC](https://forum.ansible.com/t/default-value-vs-default-value-defined-by-user/25073 "2017-07-24T22:21:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rene\_Moser](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@Rene\_Moser](https://forum.ansible.com/u/Rene_Moser)\
**Post date:** [July 24, 2017, 10:21pm UTC](https://forum.ansible.com/t/default-value-vs-default-value-defined-by-user/25073/1 "2017-07-24T22:21:21Z")

</div>

Hi

I wanted to bring awareness of a little patch I submitted a while ago (3  
lines change to the basic module\_utils helper. (I even would call it a  
bug fix).

[https://github.com/ansible/ansible/pull/16492](https://github.com/ansible/ansible/pull/16492)

Currently, for an undefined argument in a task, ansible uses the default  
value of this argument. That is absolutely fine.

When a user passes the \_same\_ value as the default value for the  
argument, should it make any difference?

It should not but it does: the "required\_one\_of, mutually\_exclusive,  
required\_together" will handle it as "user defined", even it has the  
same value.

As a consequence for a required argument: If you use a task with an arg  
that is required, the default value of this arg is "None/null". The uses  
uses "null", what happens? Ansible won't complain. The patch fixes this.

As a consequence in role defaults: In a role you specified role default  
value for a task with two mutually exclusive arguments with their  
default values. But Ansible complains, it is currently "not" possible.  
The patch fixes that.

Even if there may be some situations, where "omit" may help. Why should  
it make any difference if a user passes the same value myarg=None, or  
the module uses its default value "None"?

Thanks and take care  
René
