ansible使用密码连接远端主机
在inventory中增加环境变量:
all:
vars:
ansible_host_key_checking: False
或
all:
vars:
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
使用密码连接远端主机需要使用sshpass,所以要单独安装一下。
在inventory中增加环境变量:
all:
vars:
ansible_host_key_checking: False
或
all:
vars:
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
使用密码连接远端主机需要使用sshpass,所以要单独安装一下。