Co-authored-by: Matt Martz <matt@sivel.net>
Fixes #71920
(cherry picked from commit 4197666179
)
This commit is contained in:
parent
cd89aadec1
commit
d53d247c84
2 changed files with 5 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Fix ``RecursionError`` when templating large vars structures (https://github.com/ansible/ansible/issues/71920)
|
|
@ -257,6 +257,7 @@ def _unroll_iterator(func):
|
||||||
return list(ret)
|
return list(ret)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
wrapper.__UNROLLED__ = True
|
||||||
return _update_wrapper(wrapper, func)
|
return _update_wrapper(wrapper, func)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1025,6 +1026,7 @@ class Templar:
|
||||||
# Adds Ansible custom filters and tests
|
# Adds Ansible custom filters and tests
|
||||||
myenv.filters.update(self._get_filters())
|
myenv.filters.update(self._get_filters())
|
||||||
for k in myenv.filters:
|
for k in myenv.filters:
|
||||||
|
if not getattr(myenv.filters[k], '__UNROLLED__', False):
|
||||||
myenv.filters[k] = _unroll_iterator(myenv.filters[k])
|
myenv.filters[k] = _unroll_iterator(myenv.filters[k])
|
||||||
myenv.tests.update(self._get_tests())
|
myenv.tests.update(self._get_tests())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue