Reduce debug task

9 views
Skip to first unread message

Rahul Kumar

unread,
Jul 29, 2020, 3:58:57 AM7/29/20
to ansible...@googlegroups.com
Hi Ansible Gurus,
Is it possible to print some message in the task itself when condition is not matched , rather than having new task with debug module ?

Example: currently i am writing two tasks:
 - name: Get Active Application server
      debug:
        msg: "No active Application server found. "
      when: app_server_result is failed
  tasks:

    - include_role:
        name: myrole
        tasks_from: myapplicaton_server
      when: app_server_result is not failed

can we avoid debug statement here and can manage only with second task ?

Stefan Hornburg (Racke)

unread,
Jul 29, 2020, 4:11:33 AM7/29/20
to ansible...@googlegroups.com
Not to my knowledge and the benefits are unclear to me.

Regards
Racke

>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGH8rEw3Z6eKV9SCKOVv_edyXx1UReiomktH3oKkDP85OMR%3DfA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGH8rEw3Z6eKV9SCKOVv_edyXx1UReiomktH3oKkDP85OMR%3DfA%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc

Rahul Kumar

unread,
Jul 29, 2020, 4:25:18 AM7/29/20
to ansible...@googlegroups.com
Benifit is reducing 2 tasks in one task ! Or 10 tasks in 5 tasks ! If it can be done !

To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fae1a093-abcc-f131-db95-e30242f5f29f%40linuxia.de.
Reply all
Reply to author
Forward
0 new messages