#jinja2: lstrip_blocks: True
# Arch DevOps keys
{% 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 %}

# Client machines keys
{% for client_key in client_ssh_keys.results %}
command="borg serve --restrict-to-path {{ backup_dir }}/{{ client_key['item'] }}",restrict {{ client_key['stdout'] }}
{% endfor %}
