变量:
my:
variable:
- name: test
path: /etc/apt
cert: key.crt
我的模板
{% for key, value in item() %}
{{key}}: {{value}}
{% endfor %}
Ansible YAML
- name: test
template:
force: yes
src: test.conf.j2
dest: /tmp/test.conf"
become: yes
with_items:
- "{{ my.variable }}"
我的 YAML 应该长这样:
path: /etc/apt
cert: key.crt