安全牛云安全基础
192.168.1.101:22 ansible_ssh_user=root ansible_ssh_pass=’123456’
SSH密钥对认证:
[webservers]10.206.240.111:22 ansible_ssh_user=root ansible_ssh_key=/root/.ssh/id_rsa
10.206.240.112:22 ansible_ssh_user=root
也可以ansible.cfg在配置文件中指定:[defaults]private_key_file = /root/.ssh/id_rsa # 默认路径