是的,Ansible的hosts文件允许一个组同时包含其他组和独立的IP地址。这可以通过在组中使用“:children”关键字来实现。例如:

[web_servers]
web1.example.com
web2.example.com

[app_servers]
app1.example.com
app2.example.com

[all_servers:children]
web_servers
app_servers
db_servers.example.com

在这个例子中,“all_servers”组包含“web_servers”和“app_servers”组,以及一个名为“db_servers.example.com”的独立IP地址。

ansible的hosts里一个分组能不能既包含其他组也包含独立的ip

原文地址: https://www.cveoy.top/t/topic/fcOM 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录