将pip版本升级到之后10.0.0,当与distutils安装的软件包发生版本冲突时,使用pip 进行安装会失败:
Cannot uninstall '***'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Run Code Online (Sandbox Code Playgroud)
这可能是PyYAML, pyOpenSSL, urllib3, chardet等等.
我尝试通过卸载相应的包来管理这个问题,如;
python-yaml python-openssl python-urllib3 python-chardet
Run Code Online (Sandbox Code Playgroud)
用apt-get(Ubuntu)然后重新安装这些库pip
但是,因为可能预期删除apt-get也会删除许多依赖的附加系统包,这似乎不是一个好的做法:
The following packages will be REMOVED:
apt-xapian-index cloud-init landscape-client-ui-install oneconf python-aptdaemon python-aptdaemon.gtk3widgets python-chardet python-cupshelpers python-debian python-openssl python-pip python-requests python-ubuntu-sso-client python-urllib3 python-yaml sessioninstaller software-center ssh-import-id system-config-printer-common system-config-printer-gnome system-config-printer-udev ubuntu-desktop …Run Code Online (Sandbox Code Playgroud) [all:vars]我的ansible清单文件中有一个定义如下:
[all:vars]
ansible_shell_type=bash
ansible_user=certain_user
ansible_ssh_common_args="-o ConnectionAttempts=10"
Run Code Online (Sandbox Code Playgroud)
我计划将这些变量移动到ansible.cfg为所有主机设置默认值.它会以类似的方式工作还是有任何情况需要考虑?还有哪些其他替代品可以[all:vars]从库存文件中删除?
我想检测 Ansible 代码的每个单独任务,以便能够对依赖于其某些组件的任务进行处理。到目前为止,我尝试检测 Ansible 任务是执行regex匹配。
那么,是否有任何受支持的方法来通过某些库等获取 Ansible 任务?如果正则表达式搜索是推荐的方法,那么会建议什么regex来匹配 Ansible 任务?