首页 > 解决方案 > 这个“ansible -m ping all”是什么意思?

问题描述

ansible -m ping all

为什么我在尝试运行 Playbook 时会收到相同的警告和错误?(海星.yml)

所以,这意味着:我的剧本是对的吗?但重要的是不是。那是什么?请帮助...谢谢。

带着希望,普拉巴卡兰

以下是警告和错误:

/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init_.py:44: CyptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
     from cryptography.exceptions import InvalidSignature
[WARNING]: * Failed to parse /etc/ansible/hosts with yaml plugin: We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: No JSON object could be decoded Syntax Error while loading YAML. expected '<document start>', but found '[' The error appears to be in '/etc/ansible/hosts': line 4, column 1, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: ] [starfish] ^ here
[WARNING]: * Failed to parse /etc/ansible/hosts with ini plugin: need more than 2 values to upack
[WARNING]:  Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]:  No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' 

标签: ansible

解决方案


我认为您需要遵循此文档https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html来构建您的 ansible 库存。


推荐阅读