gpt4 book ai didi

ansible - 失败的! => {"changed": false, "msg": "apt cache update failed"} 尝试时

转载 作者:行者123 更新时间:2023-12-04 11:45:00 25 4
gpt4 key购买 nike

我是新来的 Ansible并尝试作为示例任务安装 Vivaldi .我在一个角色中的唯一任务 Vivaldi update以。。开始

    - name: Run apt upgrade
apt:
upgrade: "yes"
update_cache: yes
cache_valid_time: 432000

- name: Add Vivaldi Repository
apt_repository:
repo: "deb https://repo.vivaldi.com/stable/deb/ stable main"
state: present
filename: vivaldi.list
update_cache: true
tags:
- vivaldi
有了这个,我在 debian 10 安装的本地主机上失败了 Linux london 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux). 所有命令都在命令行上成功。
Ansible 是 2.9.15。
第一个任务运行正常(如果单独运行)但第二个任务失败 FAILED! => {"changed": false, "msg": "apt cache update failed"}.添加 repo key 的任务失败 FAILED! => {"changed": false, "id": "6D3789EDC3401E12", "msg": "key does not seem to have been added"}`
但是,如果我手动将存储库添加到 /etc/apt/sources.list最后一个任务
    - name: Install Vivaldi
apt:
name: vivaldi-stable
update_cache: yes
state: latest
tags:
- vivaldi
成功。
我究竟做错了什么?帮助表示赞赏!

最佳答案

根据官方文档,您需要添加 key ,然后添加存储库:
https://help.vivaldi.com/article/manual-setup-vivaldi-linux-repositories/
使用任务 Add key 编辑您的剧本:

- name: Run apt upgrade
apt:
upgrade: "yes"
update_cache: yes
cache_valid_time: 432000

- name: Add key
apt_key:
url: https://repo.vivaldi.com/archive/linux_signing_key.pub
state: present
tags:
- vivaldi

- name: Add Vivaldi Repository
apt_repository:
repo: "deb https://repo.vivaldi.com/stable/deb/ stable main"
state: present
filename: vivaldi.list
update_cache: true
tags:
- vivaldi

- name: Install Vivaldi
apt:
name: vivaldi-stable
update_cache: yes
state: latest
tags:
- vivaldi

关于ansible - 失败的! => {"changed": false, "msg": "apt cache update failed"} 尝试时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64880142/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com