paulbsd-salt/states/users/sshkeys.sls

17 lines
409 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "users/map.jinja" import users with context -%}
2023-01-04 23:36:10 +01:00
{%- for username, user in users.items() %}
2020-07-10 00:58:55 +02:00
{%- if user.sshkeys is defined %}
2023-01-04 23:36:10 +01:00
{%- for name, sshkey in user.sshkeys.items() %}
ssh-key-{{ username }}-{{ name }}:
ssh_auth.{{ sshkey.state }}:
- user: {{ username }}
2020-07-10 00:58:55 +02:00
- names:
2023-01-04 23:36:10 +01:00
- {{ sshkey.value }}
2020-07-10 00:58:55 +02:00
- require:
- user: user-{{ username }}
2020-07-10 00:58:55 +02:00
{% endfor %}
{%- endif -%}
{% endfor %}