This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
pi-ansible/roles/docker/tasks/main.yml

50 lines
994 B
YAML
Raw Normal View History

2022-12-21 21:25:10 +00:00
---
- name: Add Docker PGP key
apt_key:
keyserver: keys.openpgp.org
id: 0x8D81803C0EBFCD88
state: present
- name: Add Docker apt repository
apt_repository:
repo: 'deb [arch=arm64] https://download.docker.com/linux/ubuntu focal stable'
state: present
2022-12-22 16:58:48 +00:00
update_cache: true
2022-12-21 21:25:10 +00:00
- name: Install Docker
apt:
2022-12-22 19:18:27 +00:00
name: "{{ pkgs }}"
2022-12-21 21:25:10 +00:00
state: present
2022-12-22 19:18:27 +00:00
vars:
pkgs:
- docker-ce
- docker-compose-plugin
2022-12-22 16:58:48 +00:00
- name: Create docker-compose symlink
file:
src: /usr/libexec/docker/cli-plugins/docker-compose
name: /usr/local/bin/docker-compose
state: link
2022-12-21 21:25:10 +00:00
2022-12-22 19:18:27 +00:00
- name: Install Python bindings for Docker
2022-12-21 21:25:10 +00:00
pip:
2022-12-22 19:18:27 +00:00
name: "{{ pkgs }}"
2022-12-21 21:25:10 +00:00
state: present
2022-12-22 19:18:27 +00:00
executable: pip3
vars:
pkgs:
- docker
- docker-compose
2022-12-21 21:25:10 +00:00
2022-12-22 22:34:09 +00:00
- name: Copy Docker daemon config file
template:
src: daemon.json.j2
dest: /etc/docker/daemon.json
mode: u=rw,g=r,o=r
2022-12-21 21:25:10 +00:00
- name: Set up Docker services
import_tasks: services.yml
tags:
2022-12-22 22:34:09 +00:00
- boot
2022-12-21 21:25:10 +00:00
- services