From 20beb87cb47cc822793fee2e4d0bea253ee87c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Wed, 27 Mar 2019 13:37:05 +0100 Subject: [PATCH] new example --- when-quotes.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 when-quotes.yaml diff --git a/when-quotes.yaml b/when-quotes.yaml new file mode 100644 index 0000000..1ac19ff --- /dev/null +++ b/when-quotes.yaml @@ -0,0 +1,30 @@ +- name: Effect of quotes in when conditions + gather_facts: no + hosts: localhost + vars: + a: true + b: false + c: false + tasks: + + - name: I'm skipped and that's ok + debug: + msg: I'm skipped and that's ok + when: (a and b) or c + + - name: I'm skipped and that's ok + debug: + msg: I'm skipped and that's ok + when: '(a and b) or c' + + - name: I'm skipped and that's ok + debug: + msg: I'm skipped and that's ok + when: >- + (a and b) or c + + - name: I should not be there! + fail: + msg: I should not be there! + when: ('a and b') or 'c' +