[WARNING] Ansible is being run in a world writable directory (/root/ansible), ignoring it as an ansible.cfg source. For more information see https://docs.ansible.com/ansible/devel/(Ansible无法执行命令解决)
提示配置文件有问题,但是配置文件没有问题,这个问题的原因是当前ansible的目录权限照成的。
当给ansible的上层目录设置和很大的权限之后,ansible就认为当前环境是不安全的,所以不执行命令
解决办法 chmod u+x,g-wx,o-wx ansible 看看当前目录的其他目录权限,设置成一样的就可以了,
┌──[root@vms81.liruilongs.github.io]-[~] └─$chmod u+x,g-wx,o-wx ansible ┌──[root@vms81.liruilongs.github.io]-[~] └─$ll 总用量 1312128 -rw-------. 1 root root 1474 10月 18 2018 anaconda-ks.cfg drwxr--r-- 15 root root 4096 12月 22 22:56 ansible drwxr-xr-x 2 root root 6 10月 8 20:27 baidu -rw-r--r-- 1 root root 460992512 3月 30 2021 calico_3_14.tar -rwxr-xr-x 1 root root 399186944 11月 27 10:16 calico-3.19-img.tar -rw-r--r-- 1 root root 22464 3月 30 2021 calico.yaml -rw-r--r-- 1 root root 49 12月 12 16:28 cat -rwxr-xr-x 1 root root 42592768 10月 7 00:12 coredns-1.21.tar -rw-r--r-- 1 root root 49 12月 12 16:28 env.txt drwxr-xr-x 16 root root 4096 4月 22 2020 external-storage-master -rw-r--r-- 1 root root 11662350 11月 28 20:26 external-storage-master.zip -rw-r--r-- 1 root root 334879744 12月 22 22:19 ingress-nginx-controller-img.tar -rw-r--r-- 1 root root 185 12月 16 21:25 kubeapi -rw------- 1 root root 5679 12月 16 23:11 kubeconfig.yaml -rw------- 1 root root 25687 12月 16 22:35 kube.zYxKiH -rwxr-xr-x 1 root root 41199616 10月 7 11:29 metrics-img.tar -rwxr-xr-x 1 root root 6918138 10月 7 11:29 metrics-server-v0.3.6.tar.gz -rw-r--r-- 1 root root 46082048 11月 28 20:27 nfs-client-provisioner.tar -rwxr-xr-x 1 root root 924 3月 30 2021 one-client-install.sh -rwxr-xr-x 1 root root 651 10月 6 22:32 set.sh ┌──[root@vms81.liruilongs.github.io]-[~] └─$
┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$ansible node -m ping 192.168.26.83 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } 192.168.26.82 | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false, "ping": "pong" } ┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构