将Docker Repository添加到APT源时出现错误

问题描述 投票:0回答:1

[我正在尝试使用ansible脚本将docker存储库添加到ubuntu 16.04上的APT源中:

 - name: Add Docker Repository to APT sources
      apt_repository:
          repo: "{{ docker_apt_repository_details }}"
          update_cache: yes
          state: present
      become: true

其中,docker_apt_repository_details定义为:

docker_apt_repository_details: deb https://apt.dockerproject.org/repo ubuntu-xenial main

但是,已经观察到以下错误,请注意,完成的ansible脚本没有任何变化,一个月前运行良好。请提出如何解决此问题的建议?

module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_soFQp0/ansible_module_apt_repository.py\", line 556, in <module>\r\n    main()\r\n  File \"/tmp/ansible_soFQp0/ansible_module_apt_repository.py\", line 544, in main\r\n    cache.update()\r\n  File \"/usr/lib/python2.7/dist-packages/apt/cache.py\", line 522, in update\r\n    raise FetchFailedException(e)\r\napt.cache.FetchFailedException: W:The repository 'https://apt.dockerproject.org/repo ubuntu-xenial Release' does not have a Release file., W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., W:See apt-secure(8) manpage for repository creation and user configuration details., E:Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/binary-amd64/Packages  404  Not Found, E:Some index files failed to download. They have been ignored, or old ones used instead.\r\n", 
21:38:11                "msg": "MODULE FAILURE",

以下是在失败的任务之前使用的任务集:

- name: Install Python 2.7.12
     raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)

   - name: Install pip
     apt:
         name: python-pip
         update_cache: yes
         state: latest
     become: true
     become_method: sudo

   - name: Update ubuntu image
     apt:
         update_cache: yes
     become: true

   - name: Ensure APT works with https method
     apt:
         name: "apt-transport-https"
         update_cache: yes
         state: latest
     become: true

   - name: Install CA certificates
     apt:
         name: "ca-certificates"
         update_cache: yes
         state: latest
     become: true

   - name: Add official Docker repository GPG key
     apt_key:
         keyserver: "{{ docker_apt_key_url }}"
         id: "{{ docker_apt_key_id }}"
         state: present
     become: true

   - name: Add Docker Repository to APT sources
     apt_repository:
         repo: "{{ docker_apt_repository_details }}"
         update_cache: yes
         state: present
     become: true```
python docker ubuntu ansible ubuntu-16.04
1个回答
0
投票

dockerproject.org APT和YUM存储库已关闭:

[注意:关闭dockerproject.org APT和YUM存储库2020-03-31Docker将在2020年3月31日关闭托管在“ dockerproject.org”和“ dockerproject.com”上的APT和YUM存储库。

[我们注意到该项目正在引用这些存储库之一,并建议进行更新以使用“ download.docker.com”存储库以防止中断。

更多信息:https://www.docker.com/blog/changes-dockerproject-org-apt-yum-repositories/

-https://apt.dockerproject.org/repo

© www.soinside.com 2019 - 2024. All rights reserved.