标签: ansible ansible-inventory
我想知道是否可以列出清单中存在的所有节点以将其写入文件中?
为例:
我需要这样做,因为我使用反向代理,它是在我的vhost文件中自动输入我的新节点。
答案 0 :(得分:0)
试试这个:
- name: write hosts copy: dest: <your-name>.txt content: {{ groups.ungrouped | union(groups.<some-groups-you-have>) | join("\n") }}