Want to send notification if no hosts match

17 views
Skip to first unread message

Vicky .

unread,
Dec 20, 2019, 11:57:54 AM12/20/19
to ansible...@googlegroups.com
Hi,

I have a use case where I am automating switch patching where engineers can select a switch name and playbook name from a web portal.
I would to like to handle an exception if engineers select a wrong switch/playbook.

But the problem is all the tasks are skipped if engineers select a wrong switch or wrong playbook which is expected.

But I want to make sure to send them a notification if this happens. Is there any way to do that?

Thank you in advance.

Best wishes,
Bikram

Dick Visser

unread,
Dec 20, 2019, 2:17:41 PM12/20/19
to ansible...@googlegroups.com
This is a very academic question. To avoid having to do hypothetical exercises and lots of guessing - please share your playbooks and the inventory that your “web portal” supplies (or any other relevant data).

In short we need more information. 



At first glance this sounds like a problem that is out

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAEFfMJQnG7vZ03Hbpxv%2BaXSOZjChP39vgN%2BNpk0_RSxmcvHDug%40mail.gmail.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Ankit Vashistha

unread,
Dec 23, 2019, 1:17:43 AM12/23/19
to Ansible Project
Check this.

You can perform custom actions when something fails. I guess there are also ways to control if your job needs to fail or skip to next. I havent tried it though, check out ansible docs.

Regards,
Ankit


--
Reply all
Reply to author
Forward
0 new messages