ansible 版本:2.9.27
正常情况下执行:
[(04:32:52) root@vm1 yaml]
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
pip install kubernetes 结果导致执行ansible 命令报错
Traceback (most recent call last):
File "/usr/bin/ansible-doc", line 62, in <module>
import ansible.constants as C
File "/usr/lib/python2.7/site-packages/ansible/constants.py", line 19, in <module>
from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value
File "/usr/lib/python2.7/site-packages/ansible/config/manager.py", line 17, in <module>
from yaml import load as yaml_load
File "/usr/lib64/python2.7/site-packages/yaml/__init__.py", line 362
class YAMLObject(metaclass=YAMLObjectMetaclass):
SyntaxError: invalid syntax
重装 yaml
pip uninstall pyyaml &&pip install pyyaml
yum reinstall python-yaml -y
ansible 版本:2.9.27正常情况下执行:[(04:32:52) root@vm1 yaml]# ansible --versionansible 2.9.27config file = /etc/ansible/ansible.cfgconfigured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]ansible python module
执行ansible命令时报错
ERROR! Unexpected Exception, this is probably a bug: Error -5 while decompressing data: incomplete or truncated stream
详细报错如下
[root@localhost tmp]# ansible -h
ERROR! Unexpected Exception, this is probably a bug: Error -5 while .
ansible执行命令出错
报错:ERROR! Unexpected Exception, this is probably a bug: (cryptography 0.8.2 (/usr/lib64/python2.7/site-packages), Requirement.parse('cryptography>=1.1'))
删除列出软件包,并重装即可
rpm -qa...
Ansible报错The module failed to execute correctly, you probably need to set the interpreter.
ansible 执行 shell 报错:“msg”: “non-zero return code”, “rc”: 1
playbook 配置
- name: check apache httpd progress
command: /bin/bash -c "ps -ef | grep apache | grep -v apache"
register: ps_apa...
目录简介一、Ansible 的安装二、构建Anisble清单1 普通用户执行ansible命令ssh免密host_key_checkingvisudo 免密2 ansible命令3 Inventory文件配置单层清单的书写及查看嵌套式清单设定及查看主机规格的范围化操作指定其他清单文件4 Ansible与正则5 Ansible 配置文件参数详解
3台虚拟机Ansible、node1、node2(rhel8.2 的镜像,可以相互连接)
真机 172.25.28.250
node1 172.25.
一、在ansible安装完毕后一般需要以SSH的方式连接到需要进行管理的目标主机,一开始遇到了如下问题:
192.168.15.4 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-k...
[root@packstack-controller21 ~(keystone_admin)]# openstack server list
+--------------------------------------+------+--------+----------+--------+---------+
| ID | Name | Status | Networks | Image | Fl