I want to join two variables in ansible playbook to store in another variable to use it further in the code.
I tried as below, but encountering errors
- debug: msg = “{{ ver1 ~ ver2 }}”
set_fact:
version{{msg}}
ERROR! conflicting action statements (debug, set_fact)
The error appears to have been in ‘/home/devOps/upgradeTeradata/shruthi.yml’: line 63, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- debug: msg = “value is {{ ver1 ~ ver2 }}”
- debug: msg = “{{ ver1 ~ ver2 }}”
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- “{{ foo }}”
please help…