1、向各主机分发秘钥方法一---- name: 配置ssh免秘钥连接 hosts: new gather_facts: false connection: local #本地连接 tasks: - name: configure ssh connection shell: | ssh-keyscan {{inventory_hostname}} >>~/.ssh/known_hosts sshpass -p'密码'
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号