发现在删掉 ~/.ssh/know_hosts 之后运行 ansible api 会出现以下提示 The authenticity of host '10.1.*.* (10.1.*.*)' can't be established. RSA key fingerprint is ::a5:c0:f8:4a:a2:d2:1a:ef::8f::f5:dd:4a. Are you sure you want to continue connecting (yes/no)? 因为在脚本里面自动运行调用
# 检查主机连接 # ansible test -m ping # 执行远程命令 # ansible test -m command -a 'uptime' # 执行主控端脚本 # ansible test -m script -a '/etc/ansible/script/test.sh' # 执行远程主机的脚本 # ansible test -m shell -a 'ps aux|grep zabbix' # 类似shell # ansible test -m raw -a "ps aux|