diff --git a/changelogs/fragments/pathlist_strip.yml b/changelogs/fragments/pathlist_strip.yml new file mode 100644 index 00000000000..b90f7e42bc7 --- /dev/null +++ b/changelogs/fragments/pathlist_strip.yml @@ -0,0 +1,2 @@ +bugfixes: + - also strip spaces around config values in pathlist as we do in list types diff --git a/lib/ansible/config/manager.py b/lib/ansible/config/manager.py index 5310c7eb044..7bff979d651 100644 --- a/lib/ansible/config/manager.py +++ b/lib/ansible/config/manager.py @@ -137,7 +137,7 @@ def ensure_type(value, value_type, origin=None): elif value_type == 'pathlist': if isinstance(value, string_types): - value = value.split(',') + value = [x.strip() for x in value.split(',')] if isinstance(value, Sequence): value = [resolve_path(x, basedir=basedir) for x in value]