【问题标题】:How to install ansible on a RHEL machine which doesn't have access to Internet如何在无法访问 Internet 的 RHEL 机器上安装 ansible
【发布时间】:2019-05-28 13:17:55
【问题描述】:

如何在无法访问 Internet 的 RHEL 6.8 机器上安装 ansible?

【问题讨论】:

  • 嗨,阿伦,欢迎来到 SO。由于两件事,您的问题有被关闭的风险:第一是这些问题应该转到serverfault,因为它与编程无关。第二个是你没有说你已经尝试过的任何步骤;阅读how to ask 将大大有助于提高您在此逗留期间的工作效率。
  • 我不同意,因为 ansible 对于 SO 来说是一个成熟的话题,而 ansible bootstrap 是一个大话题。

标签: ansible rhel


【解决方案1】:

我建议使用raw: 模块。将 rpm (scp) 复制到服务器,然后运行 ​​rpm -i。

Raw 模块不使用通常的 ansible 工作流程,而是“直接”做事。这是我的代码来安装 python 如果它不存在于服务器上,我认为你也可以将它用于 rpm for ansible。

- hosts: all
  gather_facts: no
  tasks:
   - name: Remember sever key and install python
     raw: test -x /usr/bin/python || sudo apt-get update && sudo apt-get -y install python
     changed_when: True

【讨论】:

    猜你喜欢
    • 2020-01-26
    • 1970-01-01
    • 2020-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    • 2018-07-27
    • 2023-01-20
    相关资源
    最近更新 更多