gpt4 book ai didi

java - apt_repository 模块失败

转载 作者:行者123 更新时间:2023-12-01 14:21:50 25 4
gpt4 key购买 nike

有时当我运行我的剧本时,它会引发下一个失败:

FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1457967885.72-104659711487416/apt_repository\", 
line 3210, in <module>\r\n main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1457967885.72-104659711487416/apt_repository\", line 469, in main\r\n` `cache.update()\r\n File \"/usr/lib/python2.7/dist-packages/apt/cache.py\", line 440,
in update\r\n raise FetchFailedException(e)\r\napt.cache.FetchFailedException: W:Imposible obtener` `http://security.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources` `La suma hash difiere\r\n,
W:Imposible obtener http://security.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages La suma hash difiere\r\n, W:Imposible obtener http://security.ubuntu.com/ubuntu/dists/trusty-security/main/binary-i386/Packages La suma hash difiere\r\n,
E:Algunos archivos de` `índice fallaron al descargar. Se han ignorado, o se han utilizado unos` `antiguos en su lugar\r\n",
"msg": "MODULE FAILURE", "parsed": false}

剧本中“有时”失败的部分是下一个:
- name: ppa java8
apt_repository: repo=ppa:webupd8team/java state=present update_cache=yes

最佳答案

v1。使用update_cache: no到处。ansible 2.5.2 ,远程主机:ubuntu 18.04

- name: Install MySQL utilities and workbench 4 Ubuntu
when:
- ansible_distribution == 'Ubuntu'
- ansible_architecture == 'x86_64'
become: yes
block:
- apt:
update_cache: no
- apt_repository:
repo: deb http://repo.mysql.com/apt/ubuntu/ {{ ansible_distribution_release }} mysql-apt-config
state: present
filename: mysql
update_cache: no
- apt_repository:
repo: deb http://repo.mysql.com/apt/ubuntu/ {{ ansible_distribution_release }} mysql-tools
state: present
filename: mysql
update_cache: no
- apt_key:
# url: http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x8C718D3B5072E1F5
keyserver: pool.sks-keyservers.net
id: 8C718D3B5072E1F5
state: present
- debconf:
name: mysql-apt-config
question: select-product
vtype: select
value: Ok
- debconf:
name: mysql-apt-config
question: select-tools
vtype: select
value: Enabled
- debconf:
name: mysql-apt-config
question: repo-distro
vtype: select
value: ubuntu
- debconf:
name: mysql-apt-config
question: tools-component
vtype: select
value: mysql-tools
- debconf:
name: mysql-apt-config
question: repo-url
vtype: select
value: http://repo.mysql.com/apt
- debconf:
name: mysql-apt-config
question: select-server
vtype: select
value: mysql-{{ mysql_version }}
- apt:
update_cache: yes
- apt:
name: "{{ item }}"
state: latest
install_recommends: yes
force: yes
with_items:
- mysql-apt-config
- mysql-utilities
- mysql-workbench

- name: Install MySQL CLI 4 Ubuntu
when:
- ansible_distribution == 'Ubuntu'
- ansible_architecture == 'x86_64'
become: yes
block:
- apt:
update_cache: no
- apt_repository:
repo: deb https://packagecloud.io/amjith/mycli/ubuntu/ {{ ansible_distribution_release }} main
filename: amjith_mycli
update_cache: no
- apt_key:
url: https://packagecloud.io/amjith/mycli/gpgkey
state: present
- apt:
update_cache: yes
- apt:
name: mycli
state: latest
Bug回来了。
v2。首先添加一个新 key (UPD 20-10-2020)。
- apt_key:
# url: http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x8C718D3B5072E1F5
keyserver: pool.sks-keyservers.net
id: 8C718D3B5072E1F5
state: present
- apt_repository:
repo: deb http://repo.mysql.com/apt/ubuntu/ {{ ansible_distribution_release }} mysql-apt-config
state: present
filename: mysql
- apt_repository:
repo: deb http://repo.mysql.com/apt/ubuntu/ {{ ansible_distribution_release }} mysql-tools
state: present
filename: mysql

关于java - apt_repository 模块失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35991247/

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