2019-10-27 15:25:33 +00:00
|
|
|
---
|
|
|
|
# Server/Borgbackup: Install and Setup Borgbackup Backup Crobjob - Default Debian Version
|
|
|
|
# Variables:
|
2021-09-25 21:39:19 +00:00
|
|
|
# - none
|
2019-10-27 15:25:33 +00:00
|
|
|
|
|
|
|
# Detect some more host facts
|
2023-04-28 21:25:21 +00:00
|
|
|
- name: Docker - Detect architecture
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.shell: dpkg --print-architecture
|
2019-10-27 15:25:33 +00:00
|
|
|
register: dpkg_arch
|
|
|
|
|
|
|
|
# Install docker CE
|
2023-04-28 21:25:21 +00:00
|
|
|
- name: Docker - Install docker CE APT dependencies
|
|
|
|
become: true
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.apt:
|
2019-10-27 15:25:33 +00:00
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
packages:
|
2019-11-11 17:15:33 +00:00
|
|
|
- apt-transport-https
|
|
|
|
- ca-certificates
|
|
|
|
- curl
|
|
|
|
- gnupg2
|
|
|
|
- software-properties-common
|
2023-04-28 21:25:21 +00:00
|
|
|
diff: false
|
|
|
|
- name: Docker - Add docker CE repo key
|
|
|
|
become: true
|
2024-01-20 18:51:51 +00:00
|
|
|
ansible.builtin.get_url:
|
2019-10-27 15:25:33 +00:00
|
|
|
url: https://download.docker.com/linux/debian/gpg
|
2024-01-20 18:51:51 +00:00
|
|
|
dest: /etc/apt/trusted.gpg.d/docker.asc
|
|
|
|
mode: 0644
|
|
|
|
notify: Update Apt Cache
|
2019-10-27 15:25:33 +00:00
|
|
|
|
|
|
|
# IMPORTANT: raspbian needs deb [arch=armhf] https://download.docker.com/linux/raspbian ...
|
2023-04-28 21:25:21 +00:00
|
|
|
- name: Docker - Add docker CE repo (Debian)
|
2022-02-13 19:52:02 +00:00
|
|
|
when: ansible_facts['lsb']['id'] != "Raspbian"
|
2023-04-28 21:25:21 +00:00
|
|
|
become: true
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.apt_repository:
|
2019-10-27 15:25:33 +00:00
|
|
|
repo: "deb [arch={{ dpkg_arch.stdout }}] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
|
|
|
|
state: present
|
2024-01-20 18:51:51 +00:00
|
|
|
notify: Update Apt Cache
|
2023-04-28 21:25:21 +00:00
|
|
|
- name: Docker - Add docker CE repo (Raspbian)
|
2022-02-13 19:52:02 +00:00
|
|
|
when: ansible_facts['lsb']['id'] == "Raspbian"
|
2023-04-28 21:25:21 +00:00
|
|
|
become: true
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.apt_repository:
|
2019-10-27 15:25:33 +00:00
|
|
|
repo: "deb [arch={{ dpkg_arch.stdout }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable"
|
|
|
|
state: present
|
2024-01-20 18:51:51 +00:00
|
|
|
notify: Update Apt Cache
|
|
|
|
|
|
|
|
- name: Docker - Flush handlers
|
|
|
|
meta: flush_handlers
|
2019-10-27 15:25:33 +00:00
|
|
|
|
2024-01-20 18:51:51 +00:00
|
|
|
# Docker compose V1 (python package) doesn't receive updates since 2023-06 any more, so use the V2 instead
|
|
|
|
# The community.docker.docker_compose module won't work any more!
|
2023-04-28 21:25:21 +00:00
|
|
|
- name: Docker - Install docker CE
|
|
|
|
become: true
|
2021-08-28 14:50:37 +00:00
|
|
|
ansible.builtin.apt:
|
2024-01-20 18:51:51 +00:00
|
|
|
name:
|
|
|
|
- docker-ce
|
|
|
|
- docker-compose-plugin
|
2023-04-28 21:25:21 +00:00
|
|
|
install_recommends: false
|
|
|
|
diff: false
|