- name: start container
docker_container:
name: "{{ warinfo[warname]['container'] }}"
image: "{{ warinfo[warname]['image'] }}"
state: started
ports:
- "{{ item[0]}}:{{ item[1] }}"
with_items:
- [8080,8081]
- [8080,8081]
错误提示:
"The task includes an option with an undefined variable. The error was: 'item' is undefined
提示变量未定义,是不是docker_container 这个不能循环,我看文档没说,
怎么才能实现同时映射多个端口?