【发布时间】:2021-10-16 18:34:03
【问题描述】:
我正在尝试将 geerlingguy 的this repo (谢谢!)与我的实际东西一起使用
但是我的文件中的变量不一样并且无法更改它们,因为它们已被其他任务使用...
我的结构其实是这样的:
apache2:
vhost:
- name: toto.com
add_vhost: true
add_ssl: true
- name: AAA.toto.com
add_vhost: true
add_ssl: true
- name: BBB.toto.com
add_vhost: true
add_ssl: true
- name: CCC.toto.com
add_vhost: true
add_ssl: true
我复制此任务以使用我的变量 (source) 但我的变量名为 cert_item.name
我必须翻译成cert_item.domains 来处理in this file 工作的任务。
- include_tasks: create-cert-standalone.yml
with_items:
- "{{ apache2.vhost }}"
when:
- certbot_create_if_missing
- certbot_create_method == 'standalone'
- cert_item_apache2.add_ssl | d(true)
loop_control:
loop_var: cert_item
我怎样才能将cert_item.name 传递给任务并让他阅读cert_item.domains?
【问题讨论】: