This information is already gathered and available to you by default, no need for wheel reinventing
On Sun, 21 Feb 2021 at 10:06, [email protected] <[email protected]> wrote: > Hello > > In below how can i skip the output when is not relevant or how to do this > better way ? > > 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 > > > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/c12a8da7-1a2c-4b1b-963e-a9b154601bd4n%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/c12a8da7-1a2c-4b1b-963e-a9b154601bd4n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Sent from a mobile device - please excuse the brevity, spelling and punctuation. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwPKgOcgu7CCggoSX53xOuxAoaAq_UGkizOUDddK_Z_BUQ%40mail.gmail.com.
