Skip to content

Instantly share code, notes, and snippets.

@ursinn
Last active February 4, 2021 13:15
Show Gist options
  • Save ursinn/bc74140d8bbe02bcbc2dd29786f1ebf0 to your computer and use it in GitHub Desktop.
Save ursinn/bc74140d8bbe02bcbc2dd29786f1ebf0 to your computer and use it in GitHub Desktop.
Ansible Playbook for Docker (Debian 10)
---
- hosts: all
become: true
tasks:
- name: Install aptitude using apt
apt: name=aptitude state=latest update_cache=yes force_apt_get=yes
- name: Install required system packages
apt: name={{ item }} state=latest update_cache=yes
loop: [ 'apt-transport-https', 'ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common']
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/debian buster stable
state: present
- name: Install Docker
apt: name={{ item }} state=latest update_cache=yes
loop: [ 'docker-ce', 'docker-ce-cli', 'containerd.io']
- name: Install Docker Module for Python
pip:
name: docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment