nicer template to generate authorized keys for openwrt
authorChristian Pointner <equinox@realraum.at>
Fri, 30 Nov 2018 21:36:19 +0000 (22:36 +0100)
committerChristian Pointner <equinox@realraum.at>
Fri, 30 Nov 2018 21:36:19 +0000 (22:36 +0100)
ansible/group_vars/accesspoints/main.yml
ansible/host_vars/torwaechter/main.yml

index 51cd80a..7147bbd 100644 (file)
@@ -145,10 +145,7 @@ openwrt_mixin:
       net.ipv6.conf.all.forwarding=0
 
   /etc/dropbear/authorized_keys:
-    content: |-
-      {% for key in ssh_users_root | user_ssh_keys(users) %}
-      {{ key }}
-      {% endfor %}
+    content: "{{ ssh_users_root | user_ssh_keys(users) | join('\n') }}\n"
 
   /etc/htoprc:
     file: "{{ global_files_dir }}/common/htoprc"
index 75e16de..85a516f 100644 (file)
@@ -60,16 +60,10 @@ openwrt_mixin:
         AuthorizedKeysCommandUser tuergit
 
   /etc/ssh/authorized_keys.d/root:
-    content: |-
-      {% for key in ssh_users_root | user_ssh_keys(users) %}
-      {{ key }}
-      {% endfor %}
+    content: "{{ ssh_users_root | user_ssh_keys(users) | join('\n') }}\n"
 
   /etc/ssh/authorized_keys.d/tuergit:
-    content: |-
-      {% for key in ssh_users_tuergit | user_ssh_keys(users) %}
-      {{ key }}
-      {% endfor %}
+    content: "{{ ssh_users_tuergit | user_ssh_keys(users) | join('\n') }}\n"
 
 openwrt_uci:
   system: