Skip to content

Instantly share code, notes, and snippets.

@neofob
Forked from rbq/docker.yaml
Last active September 23, 2020 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neofob/25c47e161416e268551779eabd3ccf52 to your computer and use it in GitHub Desktop.
Save neofob/25c47e161416e268551779eabd3ccf52 to your computer and use it in GitHub Desktop.
Install Docker CE on Ubuntu using Ansible
---
- hosts: all
tasks:
- name: Install prerequisites for Docker repository
apt:
name: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg2', 'software-properties-common']
update_cache: yes
- name: Add Docker GPG key
apt_key: url=https://download.docker.com/linux/ubuntu/gpg
- name: Add Docker APT repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/{{ansible_distribution|lower}} {{ansible_distribution_release}} stable
- name: Install Docker CE
apt:
name: ['docker-ce', 'docker-ce-cli', 'containerd.io']
update_cache: yes
- name: Install prerequisites for docker-compose
apt:
name: ['python3-pip', 'python3-setuptools', 'virtualenv']
- name: Install docker-compose
pip:
name: docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment