www国产亚洲精品久久小说,在线 | 一区二区三区四区,综合成人亚洲网友偷自拍,中文字幕人妻第一区,最近中文字幕mv

微思網(wǎng)絡(luò)
全國免費(fèi)電話:400-881-4699
當(dāng)前位置:首頁>微思動(dòng)態(tài) > >詳情
全國熱線電話 400-881-4699

在線留言

Ansible內(nèi)置模塊之yum_repository

發(fā)布作者:微思網(wǎng)絡(luò)   發(fā)布時(shí)間:2024-11-13   瀏覽量:0


Ansible內(nèi)置模塊之 yum_repository

yum_repository模塊是 Ansible 的內(nèi)置模塊之一,用于管理 Yum 軟件包管理器的存儲(chǔ)庫配置。它允許你添加、刪除和修改 Yum 存儲(chǔ)庫配置文件。

1. 選 項(xiàng) 說 明


選項(xiàng)

必須

類型

默認(rèn)值

說明

file

str

保存?zhèn)}庫時(shí)所使用的文件名,不包含.repo。默認(rèn)值等同于 name

name

str

存儲(chǔ)庫的唯一名稱。將在/etc/yum.repos.d/下創(chuàng)建以此名稱命名的文件

description

str

存儲(chǔ)庫的描述。

baseurl

str

用于該存儲(chǔ)庫的基礎(chǔ) URL。可以包含$releasever  $basearch  等變量。

mirrorlist

str

用于該存儲(chǔ)庫的鏡像列表 URL

metalink

str

用于該存儲(chǔ)庫的   metalinkURL。

enabled

bool

是否啟用該存儲(chǔ)庫??梢允?/span> yes no。

gpgcheck

bool

是否啟用 GPG 簽名檢查。可以是 yes no。

gpgkey

str

GPG 簽名的 URL??梢园鄠€(gè) URL,用逗號(hào)分隔。

exclude

str

從該存儲(chǔ)庫中排除的軟件包??梢允且粋€(gè)列表或用逗號(hào)分隔的字符串。

includepkgs

str

從該存儲(chǔ)庫中包含的軟件包??梢允且粋€(gè)列表或用逗號(hào)分隔的字符串。

priority

int

存儲(chǔ)庫的優(yōu)先級(jí)。

enabled_metadata

bool

是否啟用存儲(chǔ)庫的元數(shù)據(jù)。可以是 yes no。

cost

int

設(shè)置存儲(chǔ)庫的成本。

deltarpm_metadata_percentage

int

存儲(chǔ)庫的 deltarpm 元數(shù)據(jù)百分比。

skip_if_unavailable

bool

如果存儲(chǔ)庫不可用,是否跳過。可以是 yes no。

sslverify

bool

是否驗(yàn)證 SSL 證書??梢允?/span> yes no

sslcacert

str

SSLCA 證書的路徑。

sslclientcert

str

SSL 客戶端證書的路徑。

sslclientkey

str

SSL 客戶端密鑰的路徑。

state

str

present

存儲(chǔ)庫的狀態(tài)??梢允?/span> present(存在)或 absent(不存在)。

timeout

int

存儲(chǔ)庫的超時(shí)時(shí)間。

proxy

str

用于該存儲(chǔ)庫的代理 URL。

proxy_username

str

用于代理認(rèn)證的用戶名。

proxy_password

str

用于代理認(rèn)證的密碼。

username

str

用于存儲(chǔ)庫認(rèn)證的用戶名。

password

str

用于存儲(chǔ)庫認(rèn)證的密碼。


2. 用 例

# 添加一個(gè)新的 Yum 存儲(chǔ)庫
- name: Add a new Yum repository
  ansible.builtin.yum_repository:
    name: myrepo
    description: My custom repository
    baseurl: http://myrepo.example.com/centos/$releasever/os/$basearch/
    enabled: yes
    gpgcheck: yes
    gpgkey: http://myrepo.example.com/RPM-GPG-KEY-myrepo

# 刪除一個(gè)現(xiàn)有的 Yum 存儲(chǔ)庫
- name: Remove a Yum repository
  ansible.builtin.yum_repository:
    name: myrepo
    state: absent

#
禁用一個(gè)Yum 存儲(chǔ)庫
- name: Disable a Yum repository
  ansible.builtin.yum_repository:
    name: myrepo
    enabled: no

# 添加一個(gè)帶有鏡像列表的 Yum 存儲(chǔ)庫
- name: Add a Yum repository with a mirrorlist
  ansible.builtin.yum_repository:
    name: myrepo
    description: My custom repository
    mirrorlist: http://myrepo.example.com/centos/$releasever/os/$basearch/mirrorlist
    enabled: yes
    gpgcheck: yes
    gpgkey: http://myrepo.example.com/RPM-GPG-KEY-myrepo

#
為存儲(chǔ)庫設(shè)置優(yōu)先級(jí)
- name: Add a Yum repository with priority
  ansible.builtin.yum_repository:
    name: myrepo
    description: My custom repository
    baseurl: http://myrepo.example.com/centos/$releasever/os/$basearch/
    enabled: yes
    gpgcheck: yes
    gpgkey: http://myrepo.example.com/RPM-GPG-KEY-myrepo
    priority: 10

·rpm_key 是 Ansible 的內(nèi)置模塊之一, 該模塊向 RPM 數(shù)據(jù)庫添加或移除(通過 rpm –import 命令)一個(gè) GPG 密鑰
o示例

# url導(dǎo)入gpgkey
- name: Import a key from a url
  ansible.builtin.rpm_key:
    state: present
    key: http://apt.sw.be/RPM-GPG-KEY.dag.txt

#
從文件導(dǎo)入gpgkey
- name: Import a key from a file
  ansible.builtin.rpm_key:
    state: present
    key: /path/to/key.gpg

# 刪除gpgkey
- name: Ensure a key is not present in the db
  ansible.builtin.rpm_key:
    state: absent
    key: DEADB33F

#
導(dǎo)入前使用其指紋驗(yàn)證該gpgkey
- name: Verify the key, using a fingerprint, before import
  ansible.builtin.rpm_key:
    key: /path/to/RPM-GPG-KEY.dag.txt
    fingerprint: EBC6 E12C 62B1 C734 026B  2122 A20E 5214 6B8D 79E6

             

Ansible相關(guān)文章推薦


?
返回頂部