Probably not, but you could have tried yourself? Drop the moustaches as when conditions are already evaluated as jinja
On Thu, 23 Dec 2021 at 11:54, Akshay Jadhav <[email protected]> wrote: > > - name: show message if interface is not down > fail: > msg: "Interface is not down" > when: {{ interface }}.operstatus == "up" > > will this work? > On Thursday, 23 December 2021 at 12:22:41 UTC+5:30 [email protected] > wrote: > >> What does your playbook look like? >> >> On Thu, 23 Dec 2021 at 07:49, Akshay Jadhav <[email protected]> wrote: >> >>> Hi all, >>> I need a help from you guys for writing a play if Switch Interface UP >>> then playbook should end with error msg using when condition. I am kind of >>> new to ansible. So please help me out for writing this task. >>> Thank you in advance. >>> >>> -- >>> 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/b481d0ff-1160-4307-9e2d-3e1433079a02n%40googlegroups.com >>> <https://groups.google.com/d/msgid/ansible-project/b481d0ff-1160-4307-9e2d-3e1433079a02n%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/1edeb012-822f-49a9-a58a-b6084ba583f1n%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/1edeb012-822f-49a9-a58a-b6084ba583f1n%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/CAL8fbwPALROS7p63-fQTGUjWwWh6eaWrxB8m2ER3_N09FYo9kA%40mail.gmail.com.
