4

通过 Ansible 的dnf模块安装包时。我如何传递--nobest选项dnf?有没有使用原始 shell 命令的替代方法。

4

2 回答 2

0

我有类似的问题(但我正在使用 yum 包管理器)并想办法解决这里

The issue is that docker-ce has not been packaged for CentOS 8 yet.

An ugly workaround is to install containerd.io manually beforehand:

pre_tasks:
  - yum:
     name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

因此,尝试将完整的包 url 设置为包名,它肯定可以工作。

于 2020-08-23T10:35:23.937 回答
0

nobest可以在使用 playbook 中的 DNF 模块时作为参数传递

您可以在此处参考dnf_module以获取可以传递给 dnf ansible 模块的其他选项/参数

例如 :

- name: Install the latest version of Apache from the testing repo
  dnf:
    name: httpd
    enablerepo: testing
    state: present

- name: Install the latest version of Apache
  dnf:
    name: httpd
    state: present
    nobest: false
于 2022-01-30T08:57:34.043 回答