---
{%- from "users/map.jinja" import users with context -%}

{%- for user in users %}
{%- if user.sshkeys is defined %}
{%- for key in user.sshkeys %}
ssh-key-{{ user.name }}-{{ key.name }}:
  ssh_auth.{{ key.state }}:
    - user: {{ user.name }}
    - names:
      - {{ key.value }}
    - require:
      - user: user-{{ user.name }}
{% endfor %}
{%- endif -%}
{% endfor %}