【问题标题】:Ansible offline installation on Redhat Linux 8.1 with all dependencies在 Redhat Linux 8.1 上使用所有依赖项进行 Ansible 离线安装
【发布时间】:2020-12-01 20:59:13
【问题描述】:

我在 rpm 的帮助下在离线 red hat Linux 机器 8.1 上安装 ansible,但它们失败了,需要更多依赖项。 有什么方法或方法,我可以在上面安装ansible

【问题讨论】:

    标签: ansible redhat offline python-cryptography


    【解决方案1】:

    在其他 rhel 机器上,配置互联网和 ansible 存储库,安装 yumdownloader

    yum install yum-utils
    

    下载 ansible 及其依赖项:

    yumdownloader ansible --destdir /tmp/ansible_rpm --resolve
    

    注意:将/tmp/ansible_rpm更改为rhel机器中的目录。

    【讨论】:

      【解决方案2】:

      通过@gary-lopez添加到这个answer

      在其他连接的 RHEL 盒子上获取 Ansible:

      sudo subscription-manager repos --enable ansible-2.9-for-rhel-8-x86_64-rpms
      sudo yumdownloader ansible --destdir /tmp/ansible_rpm --resolve
      

      对您遇到的任何其他依赖项重复以下操作。这些 是我离线安装要求的两个依赖项:

      sudo yumdownloader python3-jinja2 --destdir /tmp/ansible_rpm --resolve
      sudo yumdownloader python3-pyyaml --destdir /tmp/ansible_rpm --resolve
      

      然后将其打包成一个 gzip 压缩的 tar-ball 以传输到离线机器:

      cd /tmp
      sudo yum install tar -y
      tar zcvf ansible_tar.tgz /tmp/ansible_rpm
      

      将 tar gzip 压缩文件传输到断开/离线的机器 通过某种方法(USB等)。例如,如果它至少是可访问的 到您连接的机器,然后您可以安全地复制到它:

      scp ansible_tar.tgz <user>@<disconnected-target>:/tmp
      

      在断开/离线目标上:

      cd /tmp
      tar zxvf ansible_rpm.tgz
      cd ansible_rpm
      yum localinstall python3-jinja2-2.10.1-2.el8_0.noarch.rpm
      yum localinstall python3-pyyaml-3.12-12.el8.x86_64.rpm
      

      最后,使用yum localinstall ansible-2.9.24-1.el8ae.noarch.rpm 安装 Ansible rpm。但是,如果由于某种原因,您确实需要绕过您不想安装的最终依赖项,那么这就是解决方法。

      在我的示例中,我们的客户无论如何都不允许安装 sshpass(因为某些原因)。使用 rpm(而不是 yum localinstall 来覆盖依赖 sshpass 的需要,因为 yum localinstall --nobest --skip-broken 由于缺少 sshpass 依赖而跳过 ansible 安装。

      rpm -i --nodeps ansible-2.9.24-1.el8ae.noarch.rpm
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-04-19
        • 1970-01-01
        • 2012-06-04
        • 1970-01-01
        • 2015-05-26
        相关资源
        最近更新 更多