From 5536ffe9784c429951f8a11185921c6316beb80d Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 4 Jan 2017 14:45:53 -0800 Subject: [PATCH] Fix OSX defaults for lists In modern ansible, parameters default to string type. This causes issues for polymorphic parameters like this module's value param. note that this fix restores ansible-2.0 and previous behaviour but it is not perfect. If a parameter is specified via key=value or given on the commandline then it will be a string before it reaches the module code. There's nothing we can do about that. Fixes #19585 --- lib/ansible/modules/system/osx_defaults.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/osx_defaults.py b/lib/ansible/modules/system/osx_defaults.py index 20eff94893..340f203b39 100644 --- a/lib/ansible/modules/system/osx_defaults.py +++ b/lib/ansible/modules/system/osx_defaults.py @@ -116,7 +116,9 @@ EXAMPLES = ''' ''' import datetime -from ansible.module_utils.basic import * +import re + +from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception # exceptions --------------------------------------------------------------- {{{ @@ -380,6 +382,7 @@ def main(): value=dict( default=None, required=False, + type='raw' ), state=dict( default="present",