--- {%- 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_port: {{ postgresql.config.main.port|default(5432) }} {% endfor %}