Skip to content

Conversation

oytal
Copy link

@oytal oytal commented Jun 8, 2025

This PR updates the template file selection regex to support optional .j2 extensions, enabling Jinja syntax highlighting and preventing editor errors when using Jinja variables in compose.yml files.

Old: selectattr('path', 'regex', '.ya?ml$') |
New: selectattr('path', 'regex', '\.ya?ml(\.j2)?$') |

This change allows files like compose.yaml.j2 and compose.yml.j2 to be recognized alongside standard YAML files.

I've tested this change in my own setup and confirmed it does not break existing configurations.

Not sure if this was a problem for anyone else but maybe worth considering merging.

@ironicbadger
Copy link
Owner

Yo dawg I heard you like to template your templates?

@oytal
Copy link
Author

oytal commented Aug 31, 2025

Yo dawg I heard you like to template your templates?

I guess I do?

Example use case is setting a http port in group vars and then reference the same variable in both compose file and in my haproxy config template. Pretty useful in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants