mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-29 11:43:48 +01:00
55 lines
1.0 KiB
YAML
55 lines
1.0 KiB
YAML
---
|
|
- hosts: all
|
|
|
|
become: yes
|
|
tasks:
|
|
|
|
# Install Docker
|
|
# --
|
|
#
|
|
- name: install prerequisites
|
|
apt:
|
|
name:
|
|
- apt-transport-https
|
|
- ca-certificates
|
|
- curl
|
|
- gnupg-agent
|
|
- software-properties-common
|
|
update_cache: yes
|
|
|
|
- name: add apt-key
|
|
apt_key:
|
|
url: https://download.docker.com/linux/ubuntu/gpg
|
|
|
|
- name: add docker repo
|
|
apt_repository:
|
|
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
|
|
|
- name: install docker
|
|
apt:
|
|
name:
|
|
- docker-ce
|
|
- docker-ce-cli
|
|
- containerd.io
|
|
update_cache: yes
|
|
|
|
- name: add user permissions
|
|
shell: "usermod -aG docker {{ ansible_env.SUDO_USER }}"
|
|
|
|
- name: Reset ssh connection for changes to take effect
|
|
meta: "reset_connection"
|
|
|
|
# Installs Docker SDK
|
|
# --
|
|
#
|
|
- name: install python package manager
|
|
apt:
|
|
name: python3-pip
|
|
|
|
- name: install python sdk
|
|
become_user: "{{ ansible_env.SUDO_USER }}"
|
|
pip:
|
|
name:
|
|
- docker
|
|
- docker-compose
|