SSH身份验证问题
任务[备份:收集事实(操作)] ***************************************** **************************************************** >
致命:[10.X.X.X]:失败! => {“ msg”:“ [警告]正在运行Ansible 在世界可写目录中 (/ mnt / c / Users / AnirudhSomanchi / Desktop / KVM / Scripting / Ansible / network / backup), 忽略它作为ansible.cfg源。有关更多信息,请参见 https://docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-in-world-writable-dir \ n {\“ socket_path \”: (https://docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-in-world-writable-dir/n {/'socket_path /':) \“ / home / SaiAnirudh / .ansible / pc / 87fd82198c \”,\“ exception \”: \“追踪(最近一次通话最近):\ n文件 \\“ / usr / bin / ansible-connection \\”,第104行,在开始\ n
self.connection._connect()\ n文件 \\“ / usr / lib / python2.7 / dist-packages / ansible / plugins / connection / network_cli.py \\”, 第327行,在_connect \ n中ssh = self.paramiko_conn._connect()\ n 文件 \\“ / usr / lib / python2.7 / dist-packages / ansible / plugins / connection / paramiko_ssh.py \\”, 第245行,位于_connect \ n self.ssh = SSH_CONNECTION_CACHE [cache_key] = self._connect_uncached()\ n文件\\“ / usr / lib / python2.7 / dist-packages / ansible / plugins / connection / paramiko_ssh.py \\”, 第368行,_connect_uncached \ n加薪 AnsibleConnectionFailure(msg)\ nAnsibleConnectionFailure:paramiko: 无法建立主机“ 10.X.X.X”的真实性。\ n ssh-rsa密钥指纹为4b595d868720e28de57bef23c90546ad。\ n \“, \“ messages \”:[[\\ vvvv \“,\”本地域套接字不存在, 启动它“],[\” vvvv \“,\”控制套接字路径为 /home/SaiAnirudh/.ansible/pc/87fd82198c \“],[\” vvvv \“,\”已加载 设置了network_os vyos \“],[\” log \“,\” network_os的cliconf插件 到vyos \“],[\” vvvv \“,\” \“]],\”错误\“:\” paramiko:真实性 无法建立主机“ 10.X.X.X”。\ nssh-rsa密钥指纹 是4b595d868720e28de57bef23c90546ad。\“}”}
使用的命令-- ansible-playbook playbook.yml -i hosts --ask-vault-pass
尝试改变 {s {1}} in Ansible.cfg
使用的命令host_key_checking = False
================================================ ====================== playbook.yml
-- ansible-playbook playbook.yml -i hosts --ask-vault-pass
================================================ ================
Main.yml
---
- hosts: all
gather_facts: false
roles:
- backup
================================================ ================
Ansible.cfg
C:\Ansible\network\backup\roles\backup\tasks\main.yml
- name: Gather facts (ops)
vyos_facts:
gather_subset: all
- name: execute Vyos run to initiate backup
vyos_command:
commands:
- sh configuration commands | no-more
register: v_backup
- name: local_action
local_action:
module: copy
dest: "C:/Users/Desktop/KVM/Scripting/Ansible/network/backup/RESULTS/Backup.out"
content: "{{ v_backup.stdout[0] }}"
================================================ ================
主机
[defaults]
host_key_checking = False
我们需要备份vyatta设备,但出现以下错误
保险柜密码:
播放[全部] ******************************************* ****************************************************** ****************
任务[备份:收集事实(操作)] ***************************************** **************************************************** >
致命:[10.X.X.X]:失败! => {“ msg”:“ [警告]正在运行Ansible 在世界可写目录中 (/ mnt / c / Users / AnirudhSomanchi / Desktop / KVM / Scripting / Ansible / network / backup), 忽略它作为ansible.cfg源。有关更多信息,请参见 https://docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-in-world-writable-dir \ n {\“ socket_path \”: (https://docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-in-world-writable-dir/n {/'socket_path /':) \“ / home / SaiAnirudh / .ansible / pc / 87fd82198c \”,\“ exception \”: \“追踪(最近一次通话最近):\ n文件 \\“ / usr / bin / ansible-connection \\”,第104行,在开始\ n
self.connection._connect()\ n文件 \\“ / usr / lib / python2.7 / dist-packages / ansible / plugins / connection / network_cli.py \\”, 第327行,在_connect \ n中ssh = self.paramiko_conn._connect()\ n 文件 \\“ / usr / lib / python2.7 / dist-packages / ansible / plugins / connection / paramiko_ssh.py \\”, 第245行,位于_connect \ n self.ssh = SSH_CONNECTION_CACHE [cache_key] = self._connect_uncached()\ n文件\\“ / usr / lib / python2.7 / dist-packages / ansible / plugins / connection / paramiko_ssh.py \\”, 第368行,_connect_uncached \ n加薪 AnsibleConnectionFailure(msg)\ nAnsibleConnectionFailure:paramiko: 无法建立主机“ 10.X.X.X”的真实性。\ n ssh-rsa密钥指纹为4b595d868720e28de57bef23c90546ad。\ n \“, \“ messages \”:[[\\ vvvv \“,\”本地域套接字不存在, 启动它“],[\” vvvv \“,\”控制套接字路径为 /home/SaiAnirudh/.ansible/pc/87fd82198c \“],[\” vvvv \“,\”已加载 设置了network_os vyos \“],[\” log \“,\” network_os的cliconf插件 到vyos \“],[\” vvvv \“,\” \“]],\”错误\“:\” paramiko:真实性 无法建立主机“ 10.X.X.X”。\ nssh-rsa密钥指纹 是4b595d868720e28de57bef23c90546ad。\“}”}
PLAY RECAP ********************************************* ****************************************************** **************
10.X.X.X:ok = 0更改= 0不可达= 0失败= 1跳过= 0获救= 0忽略= 0
答案 0 :(得分:0)
[WARNING] Ansible is in a world writable directory , ignoring it as an ansible.cfg source.
我也收到了这个警告,但这不会导致您无法执行命令。这只是警告,表示您已对不安全的目录授予了完全权限(即 drwxrwxrwx或777 )。您可以通过使用 chmod 命令(例如sudo chmod 755
)更改权限来删除此警告。