paulbsd-salt/states/users/ssh-keys.sls

17 lines
375 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- 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 %}