Skip to content

j2_environment extensions not available while generating config #1448

@alex-harvey-z3q

Description

@alex-harvey-z3q

Subject of the issue

Attempting to use J2 extensions such as this fails:

j2_environment:
  extensions:
    - jinja2_ansible_filters.AnsibleCoreFiltersExtension

project_code: "{{ var.BucketName | regex_replace('^[^a-zA-Z]+', '') }}"

This could be the expected behaviour although if so it is confusing and some of the code in the Reader class also seems to imply that the author expected these extensions to be available.

It could be a bug or something that requires better docs.

Your environment

  • version of sceptre (sceptre --version) latest
  • version of python (python --version) 3.10
  • which OS/distro ubuntu

Steps to reproduce

See above.

Expected behaviour

I expected this to work and the regex_replace filter to be available.

Actual behaviour

sceptre.exceptions.SceptreException: config.yaml - No filter named 'regex_replace'.                                                                                                                   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions