> Hello
>
> In below how can i skip the output when is not relevant or how to do this better way ?
It is not clear from your tasks or their name what you are trying to achieve.
"check OS version" - what does that mean?
More generally speaking, without knowing what you want to do, it's
also not possible to tell how to do it better.
Also, what does "relevant" mean in this context? That seems a highly
subjective term...
> Thanks
>
> ---
> -
> hosts: temp
> become: true
> remote_user: ansible
> tasks:
> - name : check OS version for Ubuntu
> raw : lsb_release -a
> when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
> register: result
> - debug:
> var: result
>
>
> - name : check OS version for CentOS
> raw : cat /etc/redhat-release
> when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat enterprise Linux'
> register: result
>
> - debug:
> var: result
>
>
Dick Visser
Trust & Identity Service Operations Manager
GÉANT