From d5e6e39f0cd16e06b82d7abbb12303ceef251317 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras <evangelos@foutras.com> Date: Sun, 18 Aug 2024 16:45:31 +0300 Subject: [PATCH] tasks/sync-ssh-hostkeys: quiet ssh-keyscan banners We don't want these comments to be added to docs/ssh-known_hosts.txt. From OpenSSH 9.8 release notes [1]: * ssh-keyscan(1): this tool previously emitted comment lines containing the hostname and SSH protocol banner to standard error. This release now emits them to standard output, but adds a new "-q" flag to silence them altogether. [1] https://www.openssh.com/txt/release-9.8 --- playbooks/tasks/sync-ssh-hostkeys.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/tasks/sync-ssh-hostkeys.yml b/playbooks/tasks/sync-ssh-hostkeys.yml index 18f8a40db..a8232ead9 100644 --- a/playbooks/tasks/sync-ssh-hostkeys.yml +++ b/playbooks/tasks/sync-ssh-hostkeys.yml @@ -16,7 +16,7 @@ - name: Fetch known_hosts shell: | set -eo pipefail - ssh-keyscan -p {{ ansible_port | default(22) }} 127.0.0.1 2>/dev/null \ + ssh-keyscan -q -p {{ ansible_port | default(22) }} 127.0.0.1 2>/dev/null \ | sed -E 's/^(\[?)127\.0\.0\.1/\1{{ inventory_hostname }}/' \ | sort environment: -- GitLab