From 583a98350589e2b3ecfeec56b026a83783effb71 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 24 Oct 2024 13:59:42 +0200 Subject: [PATCH] tests: Fix deprecated_sshd_variable test --- tests/tests_deprecated_sshd_variable.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/tests_deprecated_sshd_variable.yml b/tests/tests_deprecated_sshd_variable.yml index a2788bd..a3bbdbd 100644 --- a/tests/tests_deprecated_sshd_variable.yml +++ b/tests/tests_deprecated_sshd_variable.yml @@ -27,7 +27,15 @@ ansible.builtin.meta: flush_handlers - name: List effective configuration using sshd -T - ansible.builtin.command: sshd -T + ansible.builtin.shell: | + set -eu + if set -o | grep pipefail 2>&1 /dev/null ; then + set -o pipefail + fi + if test ! -f /etc/ssh/ssh_host_rsa_key; then + ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C '' -N '' + fi + sshd -T register: runtime changed_when: false