--- {%- from "postgresql/map.jinja" import postgresql with context %} {%- for user in postgresql.users %} postgresql_user_{{ user.name }}: postgres_user.present: - name: {{ user.name }} {%- if user.password is defined %} - password: {{ user.password }} {%- endif %} - login: {{ user.login|default(true) }} - superuser: {{ user.superuser|default(false) }} - db_user: postgres {% endfor %}