I want to run few tasks in shell if they satisfy a condition. Strangely the 
task runs if the second condition is satisfied even though the first one 
fails.

  name: ods
  shell: "/something {{state}}"
  when: ((ods) and (not (ansible_hostname | search("demlh*"))))
  register: sss_ods_out
  notify: output ods
  ignore_errors: yes

Here sss_ods is a variable defined in a vars file. If I remove the latter 
condition the task would run but I want both the conditions to be satisfied 
for the task to run and I can't understand where am I going wrong.

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2f030d29-b1fa-4c24-8ba7-7b4ab0e0562d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to