Created
January 12, 2024 13:46
-
-
Save jimfilippou/09d0e4a0ef6dfaeb524754f59fb18b4c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
- name: Install Docker (including compose) | |
hosts: all | |
become: true | |
tasks: | |
- name: Update apt cache | |
apt: | |
update_cache: yes | |
- name: Install dependencies via apt | |
apt: | |
name: | |
- ca-certificates | |
- curl | |
- gnupg | |
- name: Add Docker's official GPG key | |
apt_key: | |
url: https://download.docker.com/linux/ubuntu/gpg | |
state: present | |
- name: Add Docker's APT repository | |
apt_repository: | |
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable | |
state: present | |
- name: Update apt cache | |
apt: | |
update_cache: yes | |
- name: Install Docker | |
apt: | |
name: | |
- docker-ce | |
- docker-ce-cli | |
- containerd.io | |
- docker-buildx-plugin | |
- docker-compose-plugin | |
state: present | |
- name: Add user to Docker group | |
user: | |
name: root # Please use another user, not root :-) | |
append: yes | |
groups: docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment