【问题标题】:Install ansible off-line from binaries [duplicate]从二进制文件离线安装ansible [重复]
【发布时间】:2020-08-25 09:21:46
【问题描述】:

我们有没有网络访问的 rhel linux 机器

我们想在那台机器上安装 ansible

但我们想从二进制文件安装 ansible(不像 pip/yum install ),因为我们想避免任何 pip 依赖问题

有什么相关的方法吗?

传统方式的示例

Step 1: Update your Control Node
Any time you are installing new software, it is a good idea to ensure your existing operating system software is up to date. Let’s start with that task first.

yum update

Step 2: Install the EPEL Repository
Installing Ansible is pretty straightforward. First, we’ll need to install the CentOS 7 EPEL repository.

yum install epel-release

Step 3: Install Ansible
Next, we install the Ansible package from the EPEL repository.

yum install ansible

【问题讨论】:

  • 不清楚您所说的“来自二进制文件”是什么意思。 Ansible 基于 Python,没有二进制 Ansible AFAIK 这样的东西。您可以通过 yum、pip 安装,或者,您可以使用它设置一个 virtualenv,然后转移到非网络服务器。
  • 或者至少是通过 pip/yum 离线安装它的更好方法

标签: linux pip ansible yum rhel


【解决方案1】:

正如官方documentation 中提到的,您可以使用官方发布回购中提供的 rpm。由于您没有互联网访问权限,因此您必须将其下载到其他地方并将其复制到控制节点。

RPMs for currently supported versions of RHEL, CentOS, and Fedora are available from EPEL as well as releases.ansible.com.

或者

You can also build an RPM yourself. From the root of a checkout or tarball, use the make rpm command to build an RPM you can distribute and install

但是我不推荐Running Ansible from source (devel),因为正如文档中已经提到的,这可能是不稳定的。

Note

You should only run Ansible from devel if you are actively developing content for Ansible. This is a rapidly changing source of code and can become unstable at any point.

如果您想自己构建 rpm,您应该使用tagged releasesgithubAnsible releases 均可用

【讨论】:

    【解决方案2】:

    也许不理想,但您可以从源代码运行。我多年来一直这样做,没有任何问题。我只是将初始化例程放在我的.bashrc 文件中,所以它随时可以使用。 Running Ansible from source (devel)

    一旦你在一台可以访问互联网的机器上从 git 中拉取数据,就将它sneakernet 到你想要的机器上。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-09
      • 1970-01-01
      • 2020-05-02
      • 2016-07-19
      • 2020-08-22
      • 2013-08-12
      相关资源
      最近更新 更多