How to use variables in a Jinja2 filter?

Hi,

I am trying to create an user with password hash filter like this:

  • name: Create a user
    user:
    name: abc
    group: xyz
    password: {{ ‘mypass’|password_hash(‘sha256’, ‘mysalt’) }}

This works!
Now I would like to use variables in place of ‘mypass’ and ‘mysault’ that are defined in vars/main.yml (encrypted by vault)

Curly brackets doesn't stack, just use the variable directly without quotes.

password: "{{ password | password_hash('sha256', password_sault) }}"