From 273c3088a28872cfe6db71c7e14b1db0858d4bb6 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Fri, 7 Sep 2018 15:38:38 +0000 Subject: [PATCH] also save current ansible_host --- templates/ssh_host_key.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/ssh_host_key.j2 b/templates/ssh_host_key.j2 index fbb2cc1..3abda2d 100644 --- a/templates/ssh_host_key.j2 +++ b/templates/ssh_host_key.j2 @@ -1,5 +1,5 @@ {% if hostvars[item].ssh_ip is defined %} -{{ item }},{{ hostvars[item].ssh_ip }} ssh-ed25519 {{ hostvars[item].ssh_host_key_ed25519_public }} +{{ item }},{{ ansible_host }},{{ hostvars[item].ssh_ip }} ssh-ed25519 {{ hostvars[item].ssh_host_key_ed25519_public }} {% else %} -{{ item }} ssh-ed25519 {{ hostvars[item].ssh_host_key_ed25519_public }} +{{ item }},{{ ansible_host }} ssh-ed25519 {{ hostvars[item].ssh_host_key_ed25519_public }} {% endif %}