refactor: use modern deb822 repository module

This commit is contained in:
2026-08-04 22:12:05 +02:00
parent f59952df2b
commit bdd1c07d76
2 changed files with 11 additions and 27 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
---
requires_ansible: ">=2.14.0"
requires_ansible: ">=2.15.0"
+10 -26
View File
@@ -4,36 +4,20 @@
name:
- ca-certificates
- curl
- python3-debian ## needed for the deb822 module
state: present
update_cache: true
become: true
- name: Ensure APT keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
mode: "0755"
become: true
- name: Download Docker official 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"
become: true
- name: Get system architecture
ansible.builtin.command: dpkg --print-architecture
register: dpkg_architecture
changed_when: false
become: true
- name: Add Docker official APT repository
ansible.builtin.apt_repository:
repo: "deb [arch={{ dpkg_architecture.stdout }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts['distribution_release'] }} stable"
- name: Add Docker official APT repository (DEB822 format)
ansible.builtin.deb822_repository:
name: docker
types: deb
uris: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}"
suites: "{{ ansible_facts['distribution_release'] }}"
components: stable
signed_by: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
state: present
filename: docker
update_cache: yes
become: true
- name: Install modern Docker CE packages
@@ -77,7 +61,7 @@
gid: 9999
become: true
- name: Create appuser user for secure container execution
- name: Create app user for secure container execution
ansible.builtin.user:
name: appuser
state: present