Repository: ansible/ansible-modules-core

Issue:
dns parameter of module docker raise a type error 
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME

cloud/docker
##### ANSIBLE VERSION

```
ansible 2.1.0 (devel 0f373c1767) last updated 2016/04/23 22:41:07 (GMT +200)
  lib/ansible/modules/core: (detached HEAD 1d25c41844) last updated 2016/04/23 22:55:03 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD de22b721db) last updated 2016/04/23 22:55:04 (GMT +200)
  config file =
  configured module search path = Default w/o overrides
```
##### CONFIGURATION

<!---
Default
-->
##### OS / ENVIRONMENT

<!---
CentOs 7
-->
##### SUMMARY

Dns parameter raise the error : Docker API Error: json: cannot unmarshal string into Go value of type []string"
##### STEPS TO REPRODUCE

Create the following playbook

```

---
- hosts : XXX
  tasks : 
    - docker :
        name : container
        image : hello-world        
        dns : 
         - 8.8.4.4
```
##### EXPECTED RESULTS

container created
##### ACTUAL RESULTS

Error raised : Docker API Error: json: cannot unmarshal string into Go value of type []string

```
fatal: [XXX]: FAILED! => 
{   
 "changed": false,
 "failed": true,
 "invocation": 
     {
     "module_args": 
         {
         "cap_add": null,
         "cap_drop": null,
         "command": null,
         "count": 1,
         "cpu_set": null,
         "cpu_shares": 0,
         "debug": false,
         "detach": true,
         "devices": null,
         "dns": "['8.8.4.4']",
         "docker_api_version": "1.22",
         "docker_url": null,
         "docker_user": null,
         "domainname": null,
         "email": null,
         "entrypoint": null,
         "env": null,
         "env_file": null,
         "expose": null,
         "extra_hosts": null,
         "hostname": null,
         "image": "hello-world",
         "insecure_registry": false,
         "labels": {},
         "links": null,
         "log_driver": null,
         "log_opt": null,
         "lxc_conf": null,
         "memory_limit": 0,
         "memory_swap": 0,
         "name": "container",
         "net": null,
         "password": null,
         "pid": null,
         "ports": null,
         "privileged": false,
         "publish_all_ports": false,
         "pull": "missing",
         "read_only": null,
         "registry": null,
         "restart_policy": null,
         "restart_policy_retry": 0,
         "signal": null,
         "state": "started",
         "stdin_open": false,
         "stop_timeout": 10,
         "timeout": 60,
         "tls_ca_cert": null,
         "tls_client_cert": null,
         "tls_client_key": null,
         "tls_hostname": null,
         "tty": false,
         "ulimits": null,
         "use_tls": null,
         "username": null,
         "volumes": null,
         "volumes_from": null
         },
     "module_name": "docker"
     },
 "msg": "Docker API Error: json: cannot unmarshal string into Go value of type []string"
 }
```



Discussion:

Resolving patch:
diff --git a/cloud/docker/_docker.py b/cloud/docker/_docker.py
--- a/cloud/docker/_docker.py
+++ b/cloud/docker/_docker.py
@@ -1872,7 +1872,7 @@ def main():
             domainname      = dict(default=None),
             env             = dict(type='dict'),
             env_file        = dict(default=None),
-            dns             = dict(),
+            dns             = dict(default=None, type='list'),
             detach          = dict(default=True, type='bool'),
             state           = dict(default='started', choices=['present', 'started', 'reloaded', 'restarted', 'stopped', 'killed', 'absent', 'running']),
             signal          = dict(default=None),


Test patch: