authorized_keys.j2 552 Bytes
Newer Older
1
#jinja2: lstrip_blocks: True
2
{% set keys = [item.value.ssh_key] %}
3
4
{% if item.value.additional_ssh_keys is defined %}
	{% for key in item.value.additional_ssh_keys %}
5
		{% if inventory_hostname in key.hosts or 'all' in key.hosts %}
6
			{{- keys.append(key.name) -}}
7
8
9
		{% endif %}
	{% endfor %}
{% endif %}
10
11
12
13
14
15
16
{% 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 %}