Skip to content

Instantly share code, notes, and snippets.

@psct
Created February 26, 2021 16:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save psct/166f4cc7770adcd660ae901e28dfcde1 to your computer and use it in GitHub Desktop.
Save psct/166f4cc7770adcd660ae901e28dfcde1 to your computer and use it in GitHub Desktop.
Debian add docker repository and gpg key and install docker-ce (just for amd64)
---
- name: set up docker & compose
hosts: docker
become: yes
tasks:
- name: update package index
apt:
name: "*"
state: latest
update_cache: yes
force_apt_get: yes
- name: add packages
apt:
name: "{{ packagesdep }}"
update_cache: yes
force_apt_get: yes
state: latest
vars:
packagesdep:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- name: add docker signing key
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: add docker repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/debian buster stable
state: present
- name: update package index
apt:
name: "*"
state: latest
update_cache: yes
force_apt_get: yes
- name: install docker
apt:
name: "docker-ce"
state: latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment