jinja2 - Ansible string concat before filter -
i having issue in ansible template wanted create http basic auth credential out of 2 different variables user inputs play.
the first thing tried was:
basic_auth: "{{ user + ':' + pass | b64encode }}"
however ended with:
basic_auth: "user:<base64_encoded>"
how can have jinja concatenate these strings , pass through filter?
pretty basic solution: group parenthesis.
basic_auth: "{{ (user + ':' + pass) | b64encode }}"
i assume allow me nest several layers of filters.
complex: "{{ ((user + ':' + pass) | b64encode) | complex_filter}}"
Comments
Post a Comment