Added docker install for debian based machines
This commit is contained in:
37
docker-install.yml
Normal file
37
docker-install.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
- hosts: all
|
||||
gather_facts: True
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Install prerequisites for Docker repository
|
||||
apt:
|
||||
name: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg2', 'lsb-release']
|
||||
update_cache: yes
|
||||
|
||||
- name: Add Docker GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
|
||||
- name: Add Docker APT repository (X64)
|
||||
when: ansible_architecture == "x86_64"
|
||||
apt_repository:
|
||||
repo: deb [arch=amd64] https://download.docker.com/{{ ansible_system | lower }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
|
||||
|
||||
- name: Add Docker APT repository (aarch64)
|
||||
when: ansible_architecture == "aarch64"
|
||||
apt_repository:
|
||||
repo: deb [arch=arm64] https://download.docker.com/{{ ansible_system | lower }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
|
||||
|
||||
- name: Install Docker CE
|
||||
apt:
|
||||
name: ['docker-ce', 'docker-ce-cli', 'containerd.io']
|
||||
update_cache: yes
|
||||
|
||||
- name: Install prerequisites for docker-compose
|
||||
apt:
|
||||
name: ['python3-pip', 'python3-setuptools', 'virtualenv']
|
||||
|
||||
- name: Install docker-compose
|
||||
pip:
|
||||
name: docker-compose
|
||||
Reference in New Issue
Block a user