Optimized different roles

This commit is contained in:
2022-03-17 16:28:57 +01:00
parent 99b66dda81
commit 3f37ee5c6c
5 changed files with 37 additions and 23 deletions

View File

@@ -1 +1,3 @@
command="/home/backup/ssh-wrapper.sh" {{authorized_keys}}
{% for authorized_key in authorized_keys_list %}
command="/home/backup/ssh-wrapper.sh" {{authorized_key}}
{% endfor %}

View File

@@ -1,2 +1,2 @@
authorized_keys_path: "{{ inventory_dir }}/files/{{ inventory_hostname }}/home/backup/.ssh/authorized_keys"
authorized_keys: "{{ lookup('file', authorized_keys_path) }}"
authorized_keys_list: "{{ lookup('file', authorized_keys_path).splitlines() }}"