如何在 debian 中安装 ansible-core 2.16

问题描述 投票:0回答:1

我是 ansible 新手,但正在寻找如何安装 ansible-core 2.16 的说明,但没有成功。

所以寻找您是否可以分享在 debian 中安装 ansible-core 2.16 的说明

以下是输出:

ansible [核心 2.14.3] 配置文件=无

sudo apt install ansible-core ansible-core 已经是最新版本(2.14.3-1)。

ansible
1个回答
0
投票

如果按照官方文档在 Debian 上安装 Ansible 无法获得你想要的东西,你可以随时使用 pip 安装 Ansible。建议在Python虚拟环境中安装Ansible。例如,在 Ubuntu 24.04 中,根据您要使用的 Python 版本,安装包 python3.12-venv 并创建 Python 虚拟环境

shell> sudo apt install python3.12-venv
shell> python3 -m venv env

此命令将创建目录env。激活环境并安装ansible。还可以选择安装 ansible-lintansible-runner

shell> source env/bin/activate
(env) >  python -m pip install ansible
(env) >  python -m pip install ansible-lint
(env) >  python -m pip install ansible-runner

列出已安装的软件包

(env) > python -m pip list | grep ansible
ansible                   9.5.1
ansible-compat            4.1.11
ansible-core              2.16.6
ansible-lint              24.2.3
ansible-runner            2.3.6

目前最新版本是2.16

(env) > ansible --version
ansible [core 2.16.6]
  config file = /home/admin/.ansible.cfg
  configured module search path = ['/home/admin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/vlado/env/lib/python3.12/site-packages/ansible
  ansible collection location = /home/vlado/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/admin/env/bin/ansible
  python version = 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0] (/home/admin/env/bin/python)
  jinja version = 3.1.4
  libyaml = True
© www.soinside.com 2019 - 2024. All rights reserved.