Repository: ansible/ansible

Issue:
value must be present when state is present or absent in route53 module

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report

##### COMPONENT NAME
`route53`

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.5.0
```

##### CONFIGURATION
all defaults

##### OS / ENVIRONMENT
N/A

##### SUMMARY
In `route53` module, the option `value` is required when `state` is 'present' or 'absent'. This is not enforced right now as there is a bug in the module. The `value` option has a default value of `[]`, therefore the `required_if` statements are not taking effect.

My proposed fix would be to remove the default value for `value`.

##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->

Try to delete an existing route53 entry with the sample below. 
<!--- Paste example playbooks or commands between quotes below -->
```yaml
    - route53:
        state: absent
        zone: myzone.io
        record: pk.foo.bar.io
        type: A
```

This should not be allowed as `value` is missing. But that is not the case. The `msg` you get back instead is

`"msg": "Unexpected list element termination"`

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
The `msg` returned should have been -

`"msg": "state is absent but all of the following are missing: value"`

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
The `msg` returned was -

`"msg": "Unexpected list element termination"`



Discussion:
cc @bpennypacker @jimbydamonk
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/modules/cloud/amazon/route53.py b/lib/ansible/modules/cloud/amazon/route53.py
--- a/lib/ansible/modules/cloud/amazon/route53.py
+++ b/lib/ansible/modules/cloud/amazon/route53.py
@@ -413,7 +413,7 @@ def main():
         alias=dict(required=False, type='bool'),
         alias_hosted_zone_id=dict(required=False),
         alias_evaluate_target_health=dict(required=False, type='bool', default=False),
-        value=dict(required=False, type='list', default=[]),
+        value=dict(required=False, type='list'),
         overwrite=dict(required=False, type='bool'),
         retry_interval=dict(required=False, default=500),
         private_zone=dict(required=False, type='bool', default=False),
@@ -458,7 +458,7 @@ def main():
     ttl_in = module.params.get('ttl')
     record_in = module.params.get('record').lower()
     type_in = module.params.get('type')
-    value_in = module.params.get('value')
+    value_in = module.params.get('value') or []
     alias_in = module.params.get('alias')
     alias_hosted_zone_id_in = module.params.get('alias_hosted_zone_id')
     alias_evaluate_target_health_in = module.params.get('alias_evaluate_target_health')


Test patch: