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
|
- name: Set ssh version as fact
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
ssh_installed_version: "{{ ssh_version.stderr | regex_search('^OpenSSH_([0-9+].[0-9]+)', '\\1') | join('.') | float }}" # noqa jinja[spacing]
|
ssh_installed_version: "{{ ssh_version.stderr | regex_search('^OpenSSH_([0-9+].[0-9]+)', '\\1') | join('.') | float }}" # noqa jinja[spacing]
|
||||||
|
when: ssh_version.stderr != ""
|
||||||
tags:
|
tags:
|
||||||
- roles::cis::sshd
|
- roles::cis::sshd
|
||||||
- sshd
|
- sshd
|
||||||
|
|||||||
Reference in New Issue
Block a user