community.general.copr 模块 – 管理 Copr 仓库之一

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general。您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。

要在 playbook 中使用它,请指定:community.general.copr

community.general 2.0.0 中的新增功能

概要

  • 此模块可以启用、禁用或删除指定的仓库。

要求

以下要求需要在执行此模块的主机上满足。

  • dnf

  • dnf-plugins-core

参数

参数

说明

chroot

字符串

您想要在项目中启用/禁用/删除的 chroot 的名称,例如 epel-7-x86_64。默认 chroot 由运行模块的操作系统、操作系统版本和架构决定。

excludepkgs

列表 / 元素=字符串

在 community.general 9.4.0 中添加

要排除的软件包列表。

host

字符串

要使用的 Copr 主机。

默认值: "copr.fedorainfracloud.org"

includepkgs

列表 / 元素=字符串

在 community.general 9.4.0 中添加

要包括的软件包列表。

name

字符串 / 必需

Copr 目录名称,例如 @copr/copr-dev

protocol

字符串

这表示与主机一起使用的协议。

默认值: "https"

state

字符串

是否将此项目设置为 enableddisabledabsent

选择

  • "absent"

  • "enabled" ← (默认)

  • "disabled"

属性

属性

支持

描述

check_mode

支持: 完全

可以在 check_mode 中运行,并在不修改目标的情况下返回更改状态预测。

diff_mode

支持:

当处于差异模式时,将返回有关已更改内容(或可能需要在 check_mode 中更改的内容)的详细信息。

注意

注意

  • 支持 check_mode

示例

- name: Enable project Test of the user schlupov
  community.general.copr:
    host: copr.fedorainfracloud.org
    state: enabled
    name: schlupov/Test
    chroot: fedora-31-x86_64

- name: Remove project integration_tests of the group copr
  community.general.copr:
    state: absent
    name: '@copr/integration_tests'

返回值

常见的返回值记录在此处,以下是此模块特有的字段

描述

repo

字符串

主机上项目的路径。

返回: 成功

示例: "copr.fedorainfracloud.org/group_copr/integration_tests"

repo_filename

字符串

存储 copr 项目信息的 repo 文件的名称。

返回: 成功

示例: "_copr:copr.fedorainfracloud.org:group_copr:integration_tests.repo"

作者

  • Silvie Chlupova (@schlupov)