Ansible:没有可用于 docker-ce 的包 [英] Ansible: no package available for docker-ce
问题描述
我想在装有 Ubuntu 16.04 的远程机器上安装 Docker,使用 Ansible 并遵循 https://docs.docker.com/engine/installation/linux/ubuntu/.一切似乎都有效,直到 ansible 到达名为安装 Docker"的任务,我得到没有可用的包匹配 'docker-ce'".
I want to install Docker on a remote machine with Ubuntu 16.04, using Ansible and following the official docs at https://docs.docker.com/engine/installation/linux/ubuntu/. All seems to work, until ansible reaches the task with name "install Docker", I get "No package matching 'docker-ce' is available".
剧本的以下部分,从设置存储库的点开始:
The following part of the playbook, from the point where the repository is set:
- name: set the stable repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable
- name: Update all packages to the latest version
apt:
upgrade: dist
- name: install Docker
apt:
name: docker-ce
state: present
可能是什么问题?
推荐答案
如果 Ansible 版本 >= 2.0,您也可以使用通用 OS 包管理器模块:
Or you can use generic OS package manager module if Ansible version >= 2.0:
- name: install docker
package:
name: docker-ce
state: present
这篇关于Ansible:没有可用于 docker-ce 的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!