我试图在Ansible模块docker_container
中编写条件属性。例如,在设置var时添加log_options
。任何的想法? Ansible在这项任务中似乎没有弹性。
name: vault
become: yes
docker_container:
name: vault
image: vault
state: started
restart: yes
network_mode: host
command: server
capabilities:
- IPC_LOCK
答案 0 :(得分:2)
您可能想了解omitting parameters:
docker_container:
...
log_options: "{{ my_log_opts | default(omit) }}"
...