
對於一個非常簡單的清單文件,需要一些有關 yaml 語法的提示。
我想將 dhcp 工作站範圍包含在一個不錯的清單檔案中。關於官方文檔,這是可以完成的,但我沒有走上正確的軌道,需要一點線索。
---
all:
hosts:
site0:
hosts:
192.168.0.[100:200]
site1:
hosts:
192.168.1.[100:200]
site2:
hosts:
192.164.2.[100:200]
site3:
hosts:
192.168.3.[1.50]
有人可以幫助我實現這個目標嗎?謝謝
答案1
最終 ini *.ini 主機檔案的語法是:
[workstations_site1]
10.17.3.[1:250]
您應該使用 nmap inventory 插件,這根本不是一個好的做法。
現在我使用ansible-pull,ansible無代理更方便。