我想在 Debian 测试中使用 Ansible 2.7.7 安装 debian 软件包(还)
我尝试执行这个简单的任务:
tasks:
- name: install basic packages
apt:
name: ['mc', 'htop', 'strace','sudo','screen','lshw', 'postfix', 'etckeeper']
state: present
但是安装失败并出现奇怪的消息:
TASK [install basic packages] *********************************************************************************
fatal: [webserver.vitexsoftware.cz]: FAILED! => {"changed": false, "msg": "Could not import python modules: apt, apt_pkg. Please install python-apt package."}
to retry, use: --limit @/home/vitex/Projects/VitexSoftware/Ansible/playbooks/orchestrate.retry
apt 所需的 python 包安装为python3-apt
vitex@webserver:~/Projects/VitexSoftware/DockerTools$ aptitude search python | grep '\-apt'
i A python-apt-common - Python interface to libapt-pkg (locales)
p python-apt-dev - Python interface to libapt-pkg (development files)
p python-apt-doc - Python interface to libapt-pkg (API documentation)
i python3-apt - Python 3 interface to libapt-pkg
p python3-apt-dbg - Python 3 interface to libapt-pkg (debug extension)
v python3-apt-dbg:any -
v python3-apt:any -
p python3-aptly - Aptly REST API client and useful tooling - Python 3.x
v python3.9-apt -
v python3.9-apt-dbg -
v python3.9-apt-dbg:any -
v python3.9-apt:any -
github上有一个未解决的未解决问题:https ://github.com/ansible/ansible/issues/73535这不会以某种方式帮助我。
如何像在 Debian 10 上一样工作?