[root@centos7-79 ansible]# ansible web-servers -m ping
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details192.168.10.51 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong"}192.168.10.52 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong"}
解决方法:检查组名是否只包含了字母,数字,下划线"_",且组名不能数字开头,然后修改符合要求即可。
原因是组名用了中划线,应该改为下划线