Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite recursion loop on set_fact #1

Open
ichbinfrog opened this issue May 5, 2021 · 1 comment
Open

Infinite recursion loop on set_fact #1

ichbinfrog opened this issue May 5, 2021 · 1 comment

Comments

@ichbinfrog
Copy link

- name: Defining component_ha_enabled
set_fact:
component_ha_enabled: "{{ lookup('vars', '{{ component_name }}_ha_enabled') }}"
- name: Defining should_use_rsync_for_component_ha
set_fact:
should_use_rsync_for_component_ha: "{{ lookup('vars', 'should_use_rsync_for_{{ component_name }}_ha') }}"
- name: Defining component_user
set_fact:
component_user: "{{ lookup('vars', '{{ component_name }}_user') }}"
- name: Defining component_log_dir
set_fact:
component_log_dir: "{{ lookup('vars', '{{ component_name }}_log_dir') }}"

When the playbook reaches this role, the following error occurs: Error was a <class 'ansible.errors.AnsibleError'>, original message: recursive loop detected in template string: {{ component_name }}".

It seems that component_ha_enabled: "{{ lookup('vars', '{{ component_name }}_ha_enabled') }}" matches component_ha_enabled itself and the lookup function goes into an infinite recursion.

@baggianand
Copy link

I am also facing the same issue, is there any solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants