-
Notifications
You must be signed in to change notification settings - Fork 24k
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
template error while templating string: #84433
Comments
Files identified in the description: None If these files are incorrect, please update the |
@jyothi-balla |
Just by running what was provided in the issue description, I was not able to reproduce it on the - hosts: localhost
gather_facts: false
vars:
v:
admin_password: !unsafe "4{%!<----"
users:
pgsqladmin:
password: !unsafe "4{%!<----"
tasks:
- debug:
msg: "{{ merged_db_vars | default({}) | combine(v, recursive=True) }}"
|
@jyothi-balla You are using For example
but you are providing I would suggest adding a condition in password generation which will not have |
@jyothi-balla This Issue is waiting for your response. Please respond or the Issue will be closed. |
@jyothi-balla You have not responded to information requests in this Issue so we will assume it no longer affects you. If you are still interested in this, please create a new Issue with the requested information. |
Summary
We first try to do a lookup vault to fetch the password, the password has characters "{%!" the below is how the rendered template file looks like
during a combine step
we get the following error
" Error was a <class 'ansible.errors.AnsibleError'>, original message: template error while templating string: unexpected char '!' at 3. String: 4{%!<-ka---\n"
Have tried multiple options using to_yaml, to_json, quote
Can someone please help in getting this problem solved?
Issue Type
Bug Report
Component Name
jinja2
Ansible Version
Configuration
OS / Environment
centos8
Steps to Reproduce
We first try to do a lookup vault to fetch the password, the password has characters "{%!" the below is how the rendered template file looks like
during a combine step
Expected Results
I expected this to combine
Actual Results
" Error was a <class 'ansible.errors.AnsibleError'>, original message: template error while templating string: unexpected char '!' at 3. String: 4{%!<-ka---\n\"
Code of Conduct
The text was updated successfully, but these errors were encountered: