paulbsd-salt/states/users/ssh-keys.sls
2020-07-10 00:58:55 +02:00

17 lines
375 B
Plaintext

---
{%- 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 %}