paulbsd-salt/states/users/sshkeys.sls
2023-01-04 23:36:10 +01:00

17 lines
409 B
Plaintext

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