From 0b0503e109e758fd9171f5ea01763b5947f353e1 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 22 Jun 2023 15:45:05 +0200 Subject: [PATCH] support raise in template --- ansible/filter_plugins/raise.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ansible/filter_plugins/raise.py diff --git a/ansible/filter_plugins/raise.py b/ansible/filter_plugins/raise.py new file mode 100644 index 0000000..221716d --- /dev/null +++ b/ansible/filter_plugins/raise.py @@ -0,0 +1,11 @@ +from jinja2.exceptions import TemplateRuntimeError + +def fraise(msg): + raise TemplateRuntimeError(msg) + + +class FilterModule: + def filters(self): + return { + 'raise': fraise, + }