Skip to content

Instantly share code, notes, and snippets.

@leandroo
Last active June 21, 2024 02:23
Show Gist options
  • Save leandroo/85e9b71609ec5c2e4e1782a49cb3cc0e to your computer and use it in GitHub Desktop.
Save leandroo/85e9b71609ec5c2e4e1782a49cb3cc0e to your computer and use it in GitHub Desktop.
#!/usr/bin/env ansible-playbook
- hosts: 127.0.0.1
connection: local
tasks:
- name: Add Docker GPG key
apt_key: url=https://download.docker.com/linux/ubuntu/gpg
- name: Install basic list of packages
apt:
name: ['apt-transport-https','ca-certificates','curl','gnupg-agent','software-properties-common']
state: present
update_cache: yes
- 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 packages
apt:
name: ['docker-ce','docker-ce-cli','containerd.io']
state: present
- name: Install Docker Compose
get_url:
url : https://github.com/docker/compose/releases/download/v2.27.2/docker-compose-{{ ansible_system }}-{{ ansible_userspace_architecture }}
dest: /usr/local/bin/docker-compose
mode: '+x'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment