No ubuntu 18.04 estou executando esta função ansible (versão 2.5.1):
---
- name: Add Docker apt repository key.
apt_key:
url: "https://download.docker.com/linux/ubuntu/gpg"
state: present
- name: gather facts
setup:
- name: Set the stable docker repository
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
state: present
update_cache: yes
- name: Install Docker
apt:
name: docker-ce
state: present
Com este manual:
---
- hosts: localhost
connection: local
gather_facts: False
become: true
pre_tasks:
- name: Install python for Ansible
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
tasks:
- name: Install list of packages
apt: name={{item}} state=latest
with_items:
- nano
- git
- htop
- gitg
roles:
- {role: 'docker', tags: 'docker'}
Mas recebo o seguinte erro:
PLAY [localhost] *******************************************************************************************************************************
TASK [Install python for Ansible] **************************************************************************************************************
changed: [localhost]
TASK [docker : Add Docker apt repository key.] *************************************************************************************************
ok: [localhost]
TASK [docker : gather facts] *******************************************************************************************************************
ok: [localhost]
TASK [docker : Set the stable docker repository] ***********************************************************************************************
ok: [localhost]
TASK [docker : Install Docker] *****************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "No package matching 'docker-ce' is available"}
to retry, use: --limit @/home/user/repos/ansible-vps/src/ansible_create_workstation.retry
PLAY RECAP *************************************************************************************************************************************
localhost : ok=4 changed=1 unreachable=0 failed=1
Então, por algum motivo, o pacote docker-ce não pode ser encontrado, isso mudou recentemente ou é algo que estou fazendo de errado?
Além disso, quando eu olho: /etc/apt/sources.list ele não contém:
deb [arch=amd64] https://download.docker.com/linux/ubuntu ...
entrada.