- name: skip using the built in facts
debug:
msg: Hello
when: ansible_distribution_version is version_compare('10.0', '>=')
- name: get OS version manually
win_shell: (Get-Item -LiteralPath C:\Windows\System32\kernel32.dll).VersionInfo.ProductVersion
changed_when: False
register: os_version
- name: skip using the manually gathered OS version var
debug:
msg: World
when: os_version | trim is version_compare('10.0', '>=')
- name: skip using the manually gathered OS version var
debug:
msg: World
when: (os_version.stdout | trim) is version_compare('10.0', '>=')