1.客户端生成key
[root@localhost #] ssh-keygen
2. 拷贝到主机组 all ::: 待验证
ansible -i hosts all -m authorized_key -a "user=root key=\"{{ lookup('file', '/root/.ssh/id_rsa.pub') }}\" state=present"
1.客户端生成key
[root@localhost #] ssh-keygen
2. 拷贝到主机组 all ::: 待验证
ansible -i hosts all -m authorized_key -a "user=root key=\"{{ lookup('file', '/root/.ssh/id_rsa.pub') }}\" state=present"