I have a role to install Docker.
- name: Install Docker and role dependencies
apt:
name: "{{ item }}"
state: "present"
install_recommends: False
with_items:
- "apt-transport-https"
- "ca-certificates"
- "software-properties-common"
- "cron"
- name: Get upstream APT GPG key
apt_key:
id: "{{ docker_apt_key }}"
keyserver: "{{ ansible_local.core.keyserver
if (ansible_local|d() and ansible_local.core|d() and
ansible_local.core.keyserver)
else 'hkp://pool.sks-keyservers.net' }}"
state: "present"
- name: Configure upstream APT repository
apt_repository:
repo: "{{ docker_repository }}"
state: "present"
update_cache: True
- name: Install Docker
apt:
name: "docker-{{ docker_edition }}={{ docker_apt_package_name }}"
state: "present"
update_cache: True
install_recommends: False
cache_valid_time: "{{ docker_apt_cache_time }}"
But I get stuck with this error:
TASK [nickjj.docker : Install Docker and role dependencies] ************************************************************************************************************************************************
ok: [127.0.0.1] => (item=[u'apt-transport-https', u'ca-certificates', u'software-properties-common', u'cron'])
TASK [nickjj.docker : Get upstream APT GPG key] ************************************************************************************************************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Failed to find required executable gpg in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}
to retry, use: --limit @/home/skaouech/work/ansible/plays.retry