Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

route53

ANSIBLE VERSION

ansible 2.4.0 (devel f5f7a8c681) last updated 2017/03/30 15:20:41 (GMT -400)
config file = /Users/user/.ansible.cfg
configured module search path = [u'/Users/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
python version = 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

CONFIGURATION

N/A

OS / ENVIRONMENT

macOS 10.12.4

SUMMARY

The current route53 module should accept a list or string in the value parameter. Lists are used to have multiple values for a resource record in route53. (i.e. an NS or A record with multiple values). However, if an actual list is passed to the value parameter the module interprets it as a string split on the commas. This has the consequence of inserting a bunch of invalid data into a resource record.

i.e: value: ['ns-862.awsdns-43.net.', 'ns-449.awsdns-56.com.'] results in a resource record with the following data:

['ns-862.awsdns-43.net.'
'ns-449.awsdns-56.com.']

The ONLY way the module works with a multi-valued resource record is by specifying it as a comma separated string.

i.e: value: ns-862.awsdns-43.net., ns-449.awsdns-56.com. results in a resource record with the following data:

ns-449.awsdns-56.com.
ns-862.awsdns-43.net.

Also, while this format works it does not always honor the order of the values because of the route53 module sorts the values. i.e.

value_list = ()

if isinstance(value_in, str):
if value_in:
value_list = sorted([s.strip() for s in value_in.split(',')])
elif isinstance(value_in, list):
value_list = sorted(value_in)

Also in the code above the route53 module code attempts to detect whether a string, comma-separated string, or a list was passed to the value parameter but this code seems to have no effect and is now duplicative of functions in the AnsibleModule class. i.e. The _check_type_list function.

STEPS TO REPRODUCE

- name: AWS | Create required records on Route53 zone
route53:
zone: zone.example.com
command: create
hosted_zone_id: Z21234567890
type: NS
ttl: 172800
record: zone.example.com
value: ['ns-862.awsdns-43.net.', 'ns-449.awsdns-56.com.', 'ns-1514.awsdns-61.org.', 'ns-1730.awsdns-24.co.uk.']
overwrite: true

OR

- name: AWS | Create required records on Route53 zone
route53:
zone: zone.example.com
command: create
hosted_zone_id: Z21234567890
type: NS
ttl: 172800
record: zone.example.com
value:
- ns-862.awsdns-43.net.
- ns-449.awsdns-56.com.
- ns-1514.awsdns-61.org.
- ns-1730.awsdns-24.co.uk.
overwrite: true

EXPECTED RESULTS

ns-862.awsdns-43.net.
ns-449.awsdns-56.com.
ns-1514.awsdns-61.org.
ns-1730.awsdns-24.co.uk.

ACTUAL RESULTS

Command is successful but results in a resource record with the following out of order AND invalid data:

'ns-1514.awsdns-61.org.'
'ns-1730.awsdns-24.co.uk.']
'ns-449.awsdns-56.com.'
['ns-862.awsdns-43.net.'

Issue 2:
Issue Type:

Bug Report

Ansible Version:

ansible 1.5.2

Environment:

OSX 10.9.1

Summary:

Playbook errors out on this simple implicit localhost example.

Steps To Reproduce:

Create a playbook called test.yml with these contents:

---
- name: implicit localhost test...
hosts: localhost
tasks:
- debug: msg="hello world"

Then run the file like so:

ansible-playbook test.yml

Expected Results:

TASK: [debug msg="hello world"] ***********************************************
ok: [localhost] => {
"msg": "hello world"
}

Actual Results:

ERROR: provided hosts list is empty