diff --git a/lib/ansible/runner/filter_plugins/core.py b/lib/ansible/runner/filter_plugins/core.py index 293ebc4ae3..f792272bc2 100644 --- a/lib/ansible/runner/filter_plugins/core.py +++ b/lib/ansible/runner/filter_plugins/core.py @@ -132,6 +132,10 @@ def search(value, pattern='', ignorecase=False): def regex_replace(value='', pattern='', replacement='', ignorecase=False): ''' Perform a `re.sub` returning a string ''' + + if not isinstance(value, basestring): + value = str(value) + if ignorecase: flags = re.I else: