mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2026-11-06 10:48:47 +01:00
All people who had additional ssh keys defined in archusers.yml would get literal 'None' string in their authorized_keys file, as apparently appending a key to an array in a jinja template now (since the release of ansible 2.19) has a return value which gets templated in. Work around this by replacing this value with an empty string. Signed-off-by: Christian Heusel <christian@heusel.eu>
17 lines
558 B
Django/Jinja
17 lines
558 B
Django/Jinja
#jinja2: lstrip_blocks: True
|
|
{% set keys = [item.value.ssh_key] %}
|
|
{% if item.value.additional_ssh_keys is defined %}
|
|
{% for key in item.value.additional_ssh_keys %}
|
|
{% if inventory_hostname in key.hosts or 'all' in key.hosts %}
|
|
{% set _ = keys.append(key.name) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% for key in keys %}
|
|
{% if archusers_ssh_options is defined %}
|
|
{{ lookup('file', '../pubkeys/' + key) | regex_replace('(.*\S.*)', archusers_ssh_options + ' \\1') }}
|
|
{% else %}
|
|
{{ lookup('file', '../pubkeys/' + key) }}
|
|
{% endif %}
|
|
{% endfor %}
|