Activated loading of env depending on if it exist

This commit is contained in:
2025-07-18 19:40:34 +02:00
parent 45624037b1
commit 85195e01f9
3 changed files with 51 additions and 0 deletions

14
filter_plugins/has_env.py Normal file
View File

@@ -0,0 +1,14 @@
import os
def has_env(application_id, base_dir='.'):
"""
Check if env.j2 exists under roles/{{ application_id }}/templates/env.j2
"""
path = os.path.join(base_dir, 'roles', application_id, 'templates', 'env.j2')
return os.path.isfile(path)
class FilterModule(object):
def filters(self):
return {
'has_env': has_env,
}