EVAL OF Variable

Good afternoon Group. Any help is appreciated.

I have a survey that collects the name of a project (project_name). Lets call it SKILL

I have variables set in the playbook for all the projects to save their USER and Password Info.

  • SKILL_UNAME
  • SKILL_PWORD

I have a task that has to account for the project name and pull the values from those variables to set a temp variable in the task. Unfortunately, I keep getting an error when attempting to do a lookup and get the value of the variable:
set_fact:
temp_uname: “{{ lookup(‘vars’, project_name + ‘_UNAME’ }}”
temp_pword: “{{ lookup(‘vars’, project_name + ‘_PWORD’ }}”

Error reads: template error while templating string: unexpected ‘}’, expected ‘)’. String: {{ lookup(‘vars’, project_name + ‘_UNAME’ }}"

Any help is appreciated!

Good afternoon Group. Any help is appreciated.

I have a survey that collects the name of a project (project_name). Lets call it SKILL

I have variables set in the playbook for all the projects to save their USER and Password Info.

  • SKILL_UNAME
  • SKILL_PWORD

I have a task that has to account for the project name and pull the values from those variables to set a temp variable in the task. Unfortunately, I keep getting an error when attempting to do a lookup and get the value of the variable:
set_fact:
temp_uname: “{{ lookup(‘vars’, project_name + ‘_UNAME’ }}”
temp_pword: “{{ lookup(‘vars’, project_name + ‘_PWORD’ }}”

Missing closing parentheses

temp_uname: “{{ lookup(‘vars’, project_name + ‘_UNAME’) }}”
temp_pword: “{{ lookup(‘vars’, project_name + ‘_PWORD’) }}”

Yes… Resolved…

Thanks,