Refactor sshconfig.yml to set ssh version as fact only when ssh_version.stderr is not empty
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
- name: Set ssh version as fact
|
||||
ansible.builtin.set_fact:
|
||||
ssh_installed_version: "{{ ssh_version.stderr | regex_search('^OpenSSH_([0-9+].[0-9]+)', '\\1') | join('.') | float }}" # noqa jinja[spacing]
|
||||
when: ssh_version.stderr != ""
|
||||
tags:
|
||||
- roles::cis::sshd
|
||||
- sshd
|
||||
|
||||
Reference in New Issue
Block a user