mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 07:18:09 +02:00
Activated loading of env depending on if it exist
This commit is contained in:
14
filter_plugins/has_env.py
Normal file
14
filter_plugins/has_env.py
Normal 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,
|
||||
}
|
Reference in New Issue
Block a user