--- {%- from "users/map.jinja" import users with context -%} {%- for username,user in users.items() %} {%- if user.sshkeys is defined %} {%- for key in user.sshkeys %} ssh-key-{{ username }}-{{ key.name }}: ssh_auth.{{ key.state }}: - user: {{ username }} - names: - {{ key.value }} - require: - user: user-{{ username }} {% endfor %} {%- endif -%} {% endfor %}