From f08c36614988b8a262ff8b9d9a2ffbc5e7508717 Mon Sep 17 00:00:00 2001 From: Michele Azzolari Date: Mon, 9 Oct 2023 06:59:00 +0200 Subject: [PATCH] enable %C token if both server and client support it --- tasks/sshd.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks/sshd.yml b/tasks/sshd.yml index 946807a..d9d4fc0 100644 --- a/tasks/sshd.yml +++ b/tasks/sshd.yml @@ -20,9 +20,14 @@ - name: Set AuthorizedKeysCommand config snippet 2 set_fact: theo_agent_sshd_authorized_keys_command_computed: "{{ theo_agent_sshd_authorized_keys_command_computed }} -fingerprint %f" - when: sshd_current_version is version('6.9', '>=') + when: sshd_current_version is version('6.9', '>=') and (sshd_current_version is version('9.4', '<') or theo_agent_version is version('0.16', '<') - name: Set AuthorizedKeysCommand config snippet 3 + set_fact: + theo_agent_sshd_authorized_keys_command_computed: "{{ theo_agent_sshd_authorized_keys_command_computed }} -connection %C -fingerprint %f" + when: sshd_current_version is version('9.4', '>=') and theo_agent_version is version('0.16', '>=') + + - name: Set AuthorizedKeysCommand config snippet 4 set_fact: theo_agent_sshd_authorized_keys_command_computed: "{{ theo_agent_sshd_authorized_keys_command_computed }} %u" when: theo_agent_sshd_authorized_keys_command_computed != theo_agent_path