From 5c46bb0db7da01a8b6c1906f84e6928a7685ee13 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:25 -0400 Subject: [PATCH] Ensure backup_keys isn't empty --- roles/base/templates/var/backups/ssh/authorized_keys.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/base/templates/var/backups/ssh/authorized_keys.j2 b/roles/base/templates/var/backups/ssh/authorized_keys.j2 index 5919c71..ec6bd15 100644 --- a/roles/base/templates/var/backups/ssh/authorized_keys.j2 +++ b/roles/base/templates/var/backups/ssh/authorized_keys.j2 @@ -1,7 +1,7 @@ # backup user authorized_keys # {{ ansible_managed }} -{% if backup_keys is defined %} +{% if backup_keys is defined and backup_keys %} {% for key in backup_keys %} {{ key }} {% endfor %}