1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/root_ssh/templates/authorized_keys.j2
moson 28c73cf559
root_ssh: Add variable to define additional keys
Introduce "root_additional_keys" variable allowing us to deploy
additional root keys with our "root_ssh" role

Signed-off-by: moson <moson@archlinux.org>
2023-08-21 22:07:50 +02:00

17 lines
610 B
Django/Jinja

#jinja2: lstrip_blocks: True
{% for user in root_ssh_keys | sort(attribute="key") -%}
{% if user.hosts is not defined or inventory_hostname in user.hosts -%}
{{ lookup('file', role_path + '/../../pubkeys/' + user.key ) }}
{% if user.additional_keys is defined %}
{% for key in user.additional_keys | sort -%}
{{ lookup('file', role_path + '/../../pubkeys/' + key ) }}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% if root_additional_keys is defined %}
{% for pubkey in root_additional_keys -%}
{{ lookup('file', role_path + '/../../pubkeys/' + pubkey ) }}
{% endfor %}
{% endif %}