docker extra_host parameter expects a dictionary value for hostname, how can I use a variable?

a 夏天 提交于 2019-12-02 12:04:16

Make server_host_ip dict with set_fact before your task:

- set_fact:
    server_host_ip: "{'{{host_name}}':'{{host_ip}}'}"

And use {{server_host_ip}} in the docker module.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!