Created
March 3, 2020 12:59
-
-
Save hmartiniano/b2411c922d139555b929abd643249e92 to your computer and use it in GitHub Desktop.
Ansible playbook to install docker CE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
user: root | |
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, docker-ce-cli, containerd.io] | |
update_cache: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment