Ansible hosts群组定义与使用
作者:互联网
#正常写法
[group1]
192.168.0.1
#或指定别名
server_name1 ansible_ssh_host=192.168.100.2
[group2]
192.168.0.2
#指定密码
192.168.0.3 ansible_ssh_user=root ansible_ssh_pass=test123
#IP范围指定 20<= IP <=50
[group3]
192.168.1.[20:50]
#群组整合
[groupsa:children]
group1
group2
调用多个组
ansible group1:group2
满足groupsa但不在group3中
ansible groupsa:!group3
标签:groupsa,群组,ansible,192.168,Ansible,group1,group3,group2,hosts 来源: https://blog.csdn.net/China_AT001/article/details/115553319