2022-06-06 22:43:02 +00:00
|
|
|
---
|
|
|
|
# Docker
|
|
|
|
- name: Install prerequisites
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- apt-transport-https
|
2022-06-07 13:43:09 +00:00
|
|
|
- ca-certificates
|
|
|
|
- curl
|
2022-06-06 22:43:02 +00:00
|
|
|
- gnupg-agent
|
|
|
|
- software-properties-common
|
|
|
|
update_cache: yes
|
|
|
|
|
|
|
|
- name: Add docker 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
|
|
|
|
|
2022-06-07 13:43:09 +00:00
|
|
|
- name: Install Docker
|
2022-06-06 22:43:02 +00:00
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- docker-ce
|
|
|
|
- docker-ce-cli
|
2022-06-07 13:43:09 +00:00
|
|
|
- containerd.io
|
2022-06-06 22:43:02 +00:00
|
|
|
update_cache: yes
|
|
|
|
|
2022-06-07 13:43:09 +00:00
|
|
|
- name: Ddd user permissions
|
|
|
|
shell: "usermod -aG docker {{ lookup ('env', 'USER') }}"
|
2022-06-06 22:43:02 +00:00
|
|
|
|
|
|
|
# Python Docker SDK
|
|
|
|
- name: Install Python package manager
|
|
|
|
apt:
|
|
|
|
name: python3-pip
|
|
|
|
|
|
|
|
- name: Install Python SDK
|
|
|
|
become_user: "{{ lookup('env', 'USER') }}"
|
|
|
|
pip:
|
|
|
|
name:
|
|
|
|
- docker
|
|
|
|
- docker-compose
|
|
|
|
|
|
|
|
# Containers
|
|
|
|
- include_tasks: containers.yml
|
|
|
|
become_user: "{{ lookup('env', 'USER') }}"
|
|
|
|
when: "'docker-servers' in group_names"
|