我想在我的 Mac 上设置 ansible。我在 GNS3 中做过类似的事情,它确实有效,但这里还有更多我需要考虑的因素。所以我安装了 Ansible。我在 /etc/hosts 中添加了主机名,我可以使用我在那里提供的主机名 ping。
我创建了我要使用的 ansible 文件夹并将 ansible.cfg 放入其中:
[defaults]
hostfile = ./hosts
host_key_checking = false
timeout = 5
inventory = ./hosts
在同一个文件夹中,我有主机文件:
[tp-lab]
lab-acc0
当我尝试运行以下命令时: ansible tx-edge-acc0 -m ping
我收到以下错误:
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
[WARNING]: Unhandled error in Python interpreter discovery for host tx-edge-acc0: unexpected output from Python interpreter discovery
[WARNING]: sftp transfer mechanism failed on [tx-edge-acc0]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: scp transfer mechanism failed on [tx-edge-acc0]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: Platform unknown on host tx-edge-acc0 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information.
tx-edge-acc0 | FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"module_stderr": "Shared connection to tx-edge-acc0 closed.\r\n",
"module_stdout": "\r\nerror: unknown command: /bin/sh\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 0
知道这里可能有什么问题吗?非常感激