diff --git a/plugins/module_utils/network/common/utils.py b/plugins/module_utils/network/common/utils.py index 770d0e1c3..e8404e0ec 100644 --- a/plugins/module_utils/network/common/utils.py +++ b/plugins/module_utils/network/common/utils.py @@ -684,12 +684,15 @@ def __call__(self, value, variables=None, fail_on_undefined=True): if not fail_on_undefined: return None raise - + if value is not None: - return str(value) # Ensuring we returning it as a string + # Special handling for values starting with + + if isinstance(value, str) and value.startswith('+'): + return value # Keep the + prefix intact + return str(value) # Convert everything else to string else: return None - + def contains_vars(self, data): if isinstance(data, string_types): for marker in (