paulbsd-salt/states/users/sshkeys.sls
2022-12-24 17:50:27 +01:00

17 lines
389 B
Plaintext

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