diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 77d7502..8a99596 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -1,7 +1,16 @@ --- -- name: Installing apt-key - apt_key: id="F76221572C52609D" url=https://apt.dockerproject.org/gpg state=present +- name: Add Docker s official GPG key + remote_user: ubuntu + apt_key: + url: https://download.docker.com/linux/ubuntu/gpg + state: present + +- name: Verify that we have the key with the fingerprint + remote_user: ubuntu + apt_key: + id: 0EBFCD88 + state: present - name: Add deb repository apt_repository: @@ -9,11 +18,17 @@ state: present update_cache: yes -- name: Install - apt: pkg="{{ item }}" state=latest update_cache=yes - with_items: - - linux-image-extra-virtual - - docker-engine +- name: Update apt packages + remote_user: ubuntu + apt: + update_cache: yes + +- name: Install docker + remote_user: ubuntu + apt: + name: docker-ce + state: present + update_cache: yes - name: Create Docker group group: name=docker state=present