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