Repository: ansible/ansible

Issue:
Confusing docs for Route53 module with error from AWS
##### ISSUE TYPE
 - Documentation Report

##### COMPONENT NAME
Route53.py

##### ANSIBLE VERSION
```
ansible 2.2.1.0
  config file =
  configured module search path = Default w/o overrides
```

##### OS / ENVIRONMENT
macOS 10.12.3
python 3.6.0
boto 2.45.0

##### SUMMARY
The documentation regarding the syntax for the `value` field regarding SRV record creation is misleading and should be fixed.

##### STEPS TO REPRODUCE
While trying to automate the creation of the records (having a `domains` var setup above in the playbook with the indicated fields), using the array syntax returns an error.

Example `playbook`:

```yaml
    - name: Google XMPP
      route53:
        command: create
        zone: example{{ item.cctld }}
        record: _xmpp-server._tcp.example{{ item.cctld }}
        type: SRV
        value: [
          '5 0 5269 xmpp-server.l.google.com',
          '20 0 5269 xmpp-server1.l.google.com',
          '20 0 5269 xmpp-server2.l.google.com',
          '20 0 5269 xmpp-server3.l.google.com',
          '20 0 5269 xmpp-server4.l.google.com',
        ]
        overwrite: true
      with_items: "{{ domains }}"
```

##### EXPECTED RESULTS
The playbook should go through with the record creation procedure as expected.

##### ACTUAL RESULTS
An error was output stating the following:

<!--- Paste verbatim command output between quotes below -->
```
failed: [localhost] (item={u'googlesiteverification': u'google-site-verification=XXXX', u'dkim': u'v=DKIM1; k=rsa; p=XXXX', u'cctld': u'.com'}) => {"failed": true, "item": {"cctld": ".com", "dkim": "v=DKIM1; k=rsa; p=XXXX", "googlesiteverification": "google-site-verification=XXXX"}, "msg": "Invalid Resource Record: FATAL problem: InvalidDecimalInteger (Value is not a valid number) encountered with ''20'"}
```

##### SUGGESTION

After losing an entire morning around this, I came to the conclusion that the docs were misleading me. Regarding my need, the docs say that one should use the following syntax:

```
        value: [
          '5 0 5269 xmpp-server.l.google.com',
          '20 0 5269 xmpp-server1.l.google.com',
          '20 0 5269 xmpp-server2.l.google.com',
          '20 0 5269 xmpp-server3.l.google.com',
          '20 0 5269 xmpp-server4.l.google.com',
        ]
```
Which produced the above error. I think it's related to some parsing procedure on the array, when the service is expecting comma-separated strings. I made it work by using the following syntax:

```
        value: 5 0 5269 xmpp-server.l.google.com,20 0 5269 xmpp-server1.l.google.com,20 0 5269 xmpp-server2.l.google.com,20 0 5269 xmpp-server3.l.google.com,20 0 5269 xmpp-server4.l.google.com
```

This means that the comma-separated values also do apply to this, instead of the array notation. I think that only the docs require fixing.


Discussion:
cc @bpennypacker
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Encountered the same problem in `2.2.0.0`.  Confirmed that the fix is to remove the array.

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
@@ -207,7 +207,7 @@
       "zone": "foo.com"
       "record": "_example-service._tcp.foo.com"
       "type": "SRV"
-      "value": ["0 0 22222 host1.foo.com", "0 0 22222 host2.foo.com"]
+      "value": "0 0 22222 host1.foo.com,0 0 22222 host2.foo.com"
 
 # Add a TXT record. Note that TXT and SPF records must be surrounded
 # by quotes when sent to Route 53:


Test patch: