In a lot our templates we have loads of variables that we may or may not use within tasks. The desired behavior is 'if' the variable is not defined within vars or group_vars that we just skip the task. This has been wonderful b/c we can use the same template across multiple data centers and keep improving it over time. One of the problems we are hitting now is that when you list through with_items it will display an error prior to the when conditional being applied (pretty sure this exact error: https://github.com/ansible/ansible/issues/14383)
Within this ticket: jimi-c <https://github.com/jimi-c> We're keeping it as a warning for now. > In the future, this will be a play-ending error. The only work-around (which I have not tried) was this-> with_items: "{{ *undefined_var*| default(omit) }}" What is the preferred method? Is there a way to do this with our work-flow that makes more sense? Customized playbooks per project is not going to scale well so we really like the behavior prior to 2.2 -- 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/b799cbd8-a0c8-4c39-acd7-44bf2456edb9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
