Is it possible to add new jinja2 filter? #1040
-
In my use case I want to generate configmap with config in yaml that is generated from variables in context. service:
config:
someVar: 12
someDict:
list:
- 12
- 13 And then in configmap manifest I add something like this: apiVersion: v1
kind: ConfigMap
metadata:
name: test-configmap
data:
config.yaml: |
{{ service.config|toyaml|indent(4) }} But there is no filter |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There is also this plugin: jinja2-ansible-filter. So maybe it's possible to add that to go-jinja2 library and use |
Beta Was this translation helpful? Give feedback.
-
Oh, I've found to_yaml in docs, it seems to work as expected |
Beta Was this translation helpful? Give feedback.
Oh, I've found to_yaml in docs, it seems to work as expected