Upgrade from 1.9 to 2.4 throws "recursive loop detected" error

21 views
Skip to first unread message

Seshadri K

unread,
Feb 12, 2018, 11:41:51 PM2/12/18
to Ansible Project
Ansible newbie alert !

I am upgrading from 1.9 to 2.4. A play that works fine in the former throws up the error:

recursive loop detected in template string: {{ service_down | default(1) }}"}

The last lines in the following two files are of relevance.

Here is one of the plays that includes "application.yml" and seems to be causing the error:

___________________________________________________________________________________________________________
cat application-altfund.yml

- name: "Application: altfund"
  include: application.yml
...
...
...
           
           service_userok=1
           service_mail=
           service_down={{ service_down | default(1) }}
___________________________________________________________________________________________________________

And here is the application.yml:

___________________________________________________________________________________________________________
cat application.yml

- name: Application Service (service {{service_name}} activation using svctl and templates)
  shell: >
           svctl add
...
...
...
           --svctype-options={{service_options[service_name | hyphens_to_underscores] | default(service_options_default) | quote}}
           $([ {{service_userok}} -eq 1 ] && echo --userok)
           $([ {{service_down}} -eq 1 ] && echo --down)
___________________________________________________________________________________________________________

What is the least messy way to fix this problem? There are more than 100 files like the first one which include application.yml.

Thanks in advance !

Sesh

jn.b...@gmail.com

unread,
Feb 14, 2018, 5:12:31 AM2/14/18
to Ansible Project
Not sure, but maybe you run into this problem: https://github.com/ansible/ansible/issues/8603

Use a different variable, or what we do:
group_vars are in capital letter. Vars within playbooks or roles are in lowercases.

K. Seshadri Iyer

unread,
Feb 14, 2018, 9:25:58 AM2/14/18
to ansible...@googlegroups.com
Thanks. I renamed the variable.
Reply all
Reply to author
Forward
0 new messages