diff --git a/roles/sshd/tasks/sshd_config.yml b/roles/sshd/tasks/sshd_config.yml index 1b714b2..6e469e0 100644 --- a/roles/sshd/tasks/sshd_config.yml +++ b/roles/sshd/tasks/sshd_config.yml @@ -9,11 +9,17 @@ ansible.builtin.set_fact: _sshd_version: "{{ _sshd_version_cmd.stderr.split('_')[1].split(',')[0].split('p')[0] }}" -- name: Show detected ssh version +- name: Show detected ssh version (optional) ansible.builtin.debug: msg: "SSH Version: {{ _sshd_version }}" verbosity: 1 +- name: Show detected ssh version is > 8.0 (optional) + ansible.builtin.debug: + msg: "SSH Version: {{ _sshd_version }} is > 8.0" + verbosity: 1 + when: _sshd_version | default(7.0) | float > 8.0 + - name: Create SSHD configuration become: true ansible.builtin.template: diff --git a/roles/sshd/templates/sshd_config.j2 b/roles/sshd/templates/sshd_config.j2 index b61a262..d41d6c4 100644 --- a/roles/sshd/templates/sshd_config.j2 +++ b/roles/sshd/templates/sshd_config.j2 @@ -4,7 +4,7 @@ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. -{% if _sshd_version | default(7.0) | float > 8.0 | bool %} +{% if _sshd_version | default(7.0) | float > 8.0 %} # Include SSHD config snippets # Support fot this starts with sshd 8.0 Include /etc/ssh/sshd_config.d/*.conf diff --git a/roles/sshd/vars/main.yml b/roles/sshd/vars/main.yml index e2e03d4..2628230 100644 --- a/roles/sshd/vars/main.yml +++ b/roles/sshd/vars/main.yml @@ -1,5 +1,5 @@ --- -playbook_version_number: 5 +playbook_version_number: 6 playbook_version_path: 'l3d.users.sshd.version' l3d_users_sshd__service_var_path: