The template read `function.body`, while README and defaults/main.yaml document the key as `functions[].value`. Every documented example therefore rendered an empty function body, and with a strict undefined policy the template failed outright. The documentation is the contract for this role, so the template follows it instead of the other way around. Co-authored-by: Copilot <copilot@github.com>
23 lines
554 B
Django/Jinja
23 lines
554 B
Django/Jinja
#
|
|
# {{ ansible_managed }}
|
|
#
|
|
|
|
{% if shell_rc_file.functions is defined %}
|
|
{% for function in shell_rc_file.functions %}
|
|
function {{ function.name }} {
|
|
{{ function.value | indent(2, True) }}
|
|
}
|
|
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% if shell_rc_file.envs is defined %}
|
|
{% for env in shell_rc_file.envs %}
|
|
{{ 'export ' if env.export is defined and env.export }}{{ env.key }}="{{ env.value }}"
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if shell_rc_file.aliases is defined %}
|
|
{% for alias in shell_rc_file.aliases %}
|
|
alias {{ alias.key }}='{{ alias.value }}'
|
|
{% endfor %}
|
|
{% endif %} |