Skip to content

Instantly share code, notes, and snippets.

@acepsaepudin
Forked from rbq/docker.yaml
Created May 12, 2020 08:47
Show Gist options
  • Save acepsaepudin/91f8dc76cb5ee24650d47b7e3fc5cdcf to your computer and use it in GitHub Desktop.
Save acepsaepudin/91f8dc76cb5ee24650d47b7e3fc5cdcf to your computer and use it in GitHub Desktop.
Install Docker CE on Ubuntu using Ansible
---
- hosts: all
tasks:
- name: Install prerequisites
apt:
name: ['python3-pip', 'python3-setuptools', 'virtualenv']
update_cache: yes
- name: Install docker-compose
pip:
name: docker-compose
---
- hosts: all
tasks:
- name: Install prerequisites
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
apt:
name: docker-ce
update_cache: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment