在当前目录下配置ansible
配置ansible.cfg
[defaults] inventory = myhost # 指定主机清单文件 host_key_checking = False
配置主机清单文件
[node] node[1:3] [master] nn01 nn02 [data] nfsgw [client] client [app:children] node master data client
查看主机清单
ansible app --list-hosts
配置ansible.cfg
[defaults] inventory = myhost # 指定主机清单文件 host_key_checking = False
配置主机清单文件
[node] node[1:3] [master] nn01 nn02 [data] nfsgw [client] client [app:children] node master data client
查看主机清单
ansible app --list-hosts