Skip to content

Instantly share code, notes, and snippets.

@trigun117
Last active June 1, 2019 10:44
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 trigun117/230556daff6b7c74b7551d0e4a778adb to your computer and use it in GitHub Desktop.
Save trigun117/230556daff6b7c74b7551d0e4a778adb to your computer and use it in GitHub Desktop.
Ansible playbook for install Docker
- name: Install docker
hosts: all
become: true
tasks:
- name: Install list of packages
apt:
name: ['apt-transport-https','ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common']
state: present
update_cache: yes
- name: Add Docker GPG key
apt_key: url=https://download.docker.com/linux/{{ansible_distribution | lower}}/gpg
- name: Add Docker APT repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/{{ansible_distribution | lower}} {{ansible_distribution_release}} edge
- name: Install Docker
apt:
name: ['docker-ce', 'docker-ce-cli', 'containerd.io']
state: present
update_cache: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment