我试图遍历ansible_mounts变量并打印事实检查期间收集的安装点。根据文档,我希望以下方法能起作用:
- debug: msg={{item.mount}}
with_items: ansible_mounts
Run Code Online (Sandbox Code Playgroud)
在启用事实收集的情况下运行剧本时,会遇到很多错误。打印主机可访问的所有文件系统的正确方法是什么?看起来ansible_mounts是词典列表,所以也许我需要调整语法?我目前正在运行ansible 2.2。
此任务显示所需的信息:
- debug: msg="{{ item.mount }}"
with_items:
- "{{ ansible_mounts }}"
Run Code Online (Sandbox Code Playgroud)
要么
- debug: var=item.mount
with_items:
- "{{ ansible_mounts }}"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6667 次 |
| 最近记录: |