From e0d693e1b646536cfa65296201522d609aca567e Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Tue, 8 Jun 2021 10:26:38 -0600 Subject: [PATCH] use localhost if no SSH_CONNECTION env. var. use `127.0.0.1` for kdump_test_ssh_source if the `SSH_CONNECTION` env. var. is not defined - this is primarily for testing on a single host (i.e. the control node is the managed node) for the basic smoke test. --- tests/tests_ssh.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/tests_ssh.yml b/tests/tests_ssh.yml index fe9097d..354e879 100644 --- a/tests/tests_ssh.yml +++ b/tests/tests_ssh.yml @@ -13,7 +13,11 @@ # but is less realistic, as in practice a host can not dump core # to itself. kdump_test_ssh_server_outside: "{{ inventory_hostname }}" - kdump_test_ssh_source: "{{ ansible_env['SSH_CONNECTION'].split()[0] }}" + kdump_test_ssh_source: "{{ + ansible_env['SSH_CONNECTION'].split()[0] + if 'SSH_CONNECTION' in ansible_env + else '127.0.0.1' + }}" # this is the address at which the ssh dump server can be reached # from the managed host. Dumps will be uploaded there.