"Why didn't the interpolation code complain that TOP was undefined?"
Because we developers are horrible terrible people that want to cause you pain. I would ask what version of Ansible you are using and if undefined variable detection is turned on. If on, I would expect this to result in an error, and if not, filing a github ticket would be a good thing. Thanks! On Thu, Jul 3, 2014 at 11:23 AM, Tom Ekberg <[email protected]> wrote: > I distilled the problem down to a simple YAML file: > > - hosts: apps2 > > vars: > TOP_BAD: ".." > > tasks: > - name: check TOP > debug: msg="{{TOP}}" > > handlers: > - include: "{{TOP}}/handlers/apache_graceful.yml" > > When I save this in inc.yml and run this command: > > ansible-playbook -i ../hosts inc.yml > > I get this output: > > ERROR: file could not read: /home/tekberg/src/ansible_scripts/ > provision_apps2/{{TOP}}/handlers/apache_graceful.yml > > The actual problem is that the variable TOP is not defined, which should > have been detected prior to trying to open the file. If I change TOP_BAD to > TOP, the script runs to completion with no errors. > > Why didn't the interpolation code complain that TOP was undefined? > > -- > 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/c61e4136-5b8f-4f42-b069-22bb99ff416a%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/c61e4136-5b8f-4f42-b069-22bb99ff416a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CA%2BnsWgy5_N0WJ%3Dtk4ybMAhj_p7_5nYb8S0gv_mFwwNKmNP_-7w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
