ansible / ansible.builtin / v2.8.20 / lookup / template retrieve contents of file after templating with Jinja2 | "added in version" 0.9 of ansible.builtin" Authors: Michael DeHaan <michael.dehaan@gmail.com>ansible.builtin.template (v2.8.20) — lookup
pip
Install with pip install ansible==2.8.20
Returns a list of strings; for each template in the list of templates you pass in, returns a string containing the results of processing that template.
- name: show templating results debug: msg: "{{ lookup('template', './some_template.j2') }}"
- name: show templating results with different variable start and end string debug: msg: "{{ lookup('template', './some_template.j2', variable_start_string='[%', variable_end_string='%]') }}"
_terms: description: list of files to template convert_data: description: whether to convert YAML into data. If False, strings that are YAML will be left untouched. type: bool variable_end_string: default: '}}' description: The string marking the end of a print statement. type: str version_added: '2.8' version_added_collection: ansible.builtin variable_start_string: default: '{{' description: The string marking the beginning of a print statement. type: str version_added: '2.8' version_added_collection: ansible.builtin
_raw: description: file(s) content after templating