安装pip3
sudo apt install python3-pip
安装pipx
更新
sudo apt update
安装pipx
sudo apt install pipx -y
加入环境变量
pipx ensurepath
让环境变量生效
source ~/.bashrc
安装 venv
sudo apt install python3.8-venv
安装ansible
临时使用清华源
pipx install --include-deps ansible --force \
> --pip-args="--default-timeout=1000 -i https://pypi.tuna.tsinghua.edu.cn/simple"
安装成功:

查看版本
ansible --version

本地测试
ansible localhost -m ping
