Hi,

So, I have a task  ...

---
- name: FAILER!
  command: /bin/false
  #with_items:
  #  - one
  #  - two
  #ignore_errors: True
  ignore_errors: "{{ ignore_replication_errors | default(false) }}"

If I go ...

ansible-playbook  test.pl --extra-vars "ignore_replication_errors=false"
ansible-playbook  test.pl --extra-vars "ignore_replication_errors=true"

... it works correctly ...

localhost    : ok=5    changed=1    unreachable=0    failed=1 
... and ...
localhost    : ok=5    changed=1    unreachable=0    failed=0

However, if I change it like this ...
---
- name: FAILER!
  command: /bin/false
  with_items:
    - one
    - two
  #ignore_errors: True
  ignore_errors: "{{ ignore_replication_errors | default(false) }}"

... it always ignores ...

localhost    : ok=5    changed=1    unreachable=0    failed=0

Also, it works as expected if I take the variable out and explicitly set 
True or False ...
---
- name: FAILER!
  command: /bin/false
  with_items:
    - one
    - two
  ignore_errors: True
  #ignore_errors: "{{ ignore_replication_errors | default(false) }}"

So, it kinda feels like the variable interpretation working differently 
when I throw with_items into the mix. I was thinking that maybe using 
quotes and squiggly braces was causing the value of the variable to be 
interpreted as a string instead of a boolean, but after a lot of fiddling 
with it (using |bool etc.) I couldn't find another syntax that worked.

Is this a bug? Am I missing something?

Thanks, 
--
Glenn

PS 

ansible-playbook --version
ansible-playbook 2.3.1.0
  config file = ...
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Jun 26 2017, 10:20:05) [GCC 7.1.1 
20170622 (Red Hat 7.1.1-3)]







-- 
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/2c73adf4-110a-47d9-b27a-a9c537c16d24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to