How can I use conditional regex as not true

8 views
Skip to first unread message

Rahul Gupta

unread,
Sep 13, 2018, 10:48:56 AM9/13/18
to Ansible Project

I'm running into trouble to find the answer that how to negate the conditional with regex. Something like below:

- debug: msg="{{ Hello World}}"
  when: 
      - test.rc !=0 
      - test.stderr | find ('(No Such File or Directory)')

- debug: msg="{{ Hello Friend}}"
   when: 
        - test.rc !=0
        - <would like to use negate of "test.stderr | find ('(No Such File or Directory)')">

Looking for the expert help on this !


Thanks

Dennis McCarthy

unread,
Sep 13, 2018, 3:15:05 PM9/13/18
to Ansible Project
- rest.rc != 0
- 'No Such File or Directory' not in test.stderr

Rahul Gupta

unread,
Sep 14, 2018, 4:08:12 AM9/14/18
to Ansible Project
Thanks will try!! 
Reply all
Reply to author
Forward
0 new messages