feat: add tasks

This commit is contained in:
2025-11-17 15:06:06 +01:00
parent c5925f2a5a
commit 66f09c49bd
6 changed files with 211 additions and 0 deletions

38
tasks/installation.yml Normal file
View File

@@ -0,0 +1,38 @@
---
- name: Install dependencies to use docker's repository
ansible.builtin.apt:
name:
- ca-certificates
- curl
- gnupg
state: present
update_cache: true
- name: Create /etc/apt/keyrings directory
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
mode: "0755"
- name: Import docker GPG key
ansible.builtin.get_url:
url: https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg
dest: /etc/apt/keyrings/docker.asc
mode: "0644"
- name: Setup docker repository
ansible.builtin.apt_repository:
repo: "deb [arch={{ docker_arch }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] }} stable"
state: present
filename: docker
- name: Install docker packages
ansible.builtin.apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present
update_cache: true