23 lines
1.1 KiB
Markdown
23 lines
1.1 KiB
Markdown
|
# ansible.builtin.template
|
||
|
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.
|
||
|
|
||
|
## Parameters
|
||
|
| Parameter | Type | Description |
|
||
|
| ----------------- | ---------- | ---------------------------------------------------------------------------- |
|
||
|
| **template_vars** | dictionary | A dictionary, the keys become additional variables available for templating. |
|
||
|
|
||
|
## Examples
|
||
|
```yml
|
||
|
- name: show templating results
|
||
|
ansible.builtin.debug:
|
||
|
msg: "{{ lookup('ansible.builtin.template', './some_template.j2') }}"
|
||
|
|
||
|
- name: show templating results with different variable start and end string
|
||
|
ansible.builtin.debug:
|
||
|
msg: "{{ lookup('ansible.builtin.template', './some_template.j2', variable_start_string='[%', variable_end_string='%]') }}"
|
||
|
|
||
|
- name: show templating results with different comment start and end string
|
||
|
ansible.builtin.debug:
|
||
|
msg: "{{ lookup('ansible.builtin.template', './some_template.j2', comment_start_string='[#', comment_end_string='#]') }}"
|
||
|
```
|