From 45763f54aa0e344ce05d3d49ff39aab1f504bc2b Mon Sep 17 00:00:00 2001 From: Florian Ermisch Date: Thu, 26 Apr 2018 16:56:18 +0200 Subject: [PATCH] Add host keys from pillar[openssh:known_hosts:static] to `ssh_known_hosts` --- openssh/files/ssh_known_hosts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openssh/files/ssh_known_hosts b/openssh/files/ssh_known_hosts index 9229fd3..c57a5e9 100644 --- a/openssh/files/ssh_known_hosts +++ b/openssh/files/ssh_known_hosts @@ -66,6 +66,8 @@ {#- Loop over targetted minions -#} {%- set host_keys = salt['mine.get'](target, keys_function, tgt_type=tgt_type) -%} {%- set host_names = salt['mine.get'](target, hostname_function, tgt_type=tgt_type) -%} -{%- for host, keys in host_keys|dictsort -%} +{%- do host_keys.update(salt['pillar.get']('openssh:known_hosts:static', + {}).items()) -%} +{%- for host, keys in host_keys| dictsort -%} {{ known_host_entry(host, host_names, keys) }} {%- endfor -%}