update ansible collections sops, docker and debops
All checks were successful
/ build (pull_request) Successful in 28s
/ Ansible Lint (push) Successful in 2m36s
/ Ansible Lint (pull_request) Successful in 2m41s

This commit is contained in:
chris 2026-09-21 22:26:20 +02:00
commit e31ee5e39c
Signed by: c6ristian
SSH key fingerprint: SHA256:B3m+yzpaxGXSEcDBpPHfvza/DNC0wuX+CKMeGq8wgak
6 changed files with 27667 additions and 19786 deletions

View file

@ -9,38 +9,32 @@
- name: Install pre-reqs
ansible.builtin.apt:
name: '{{ docker_prereq_packages }}'
name: '{{ docker_prereq_packages + ["python3-debian"] }}'
state: present
update_cache: true
notify: cleanup docker
- when:
- (ansible_facts.distribution == "Ubuntu" and (ansible_facts.distribution_major_version | int) >= 22) or
(ansible_facts.distribution == "Debian" and (ansible_facts.distribution_major_version | int) >= 12)
name: Add Docker repo on Ubuntu 22+ or Debian 12+
block:
- name: Add gpg key
ansible.builtin.get_url:
url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
dest: /etc/apt/keyrings/docker.asc
- name: Add Docker repo on Ubuntu or Debian
ansible.builtin.deb822_repository:
name: docker
types: deb
architectures:
- >-
{{ 'arm64' if ansible_facts.architecture == 'aarch64' else 'amd64' }}
signed_by: "https://download.docker.com/linux/{{ ansible_facts.distribution | lower }}/gpg"
uris:
- https://download.docker.com/linux/{{ ansible_facts.distribution | lower }}
suites:
- "{{ ansible_facts.distribution_release }}"
components:
- stable
state: present
register: apt_repo
- name: Add Docker repo
ansible.builtin.apt_repository:
repo: deb [arch={{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
state: present
- when:
- (ansible_facts.distribution == "Ubuntu" and (ansible_facts.distribution_major_version | int) < 22) or
(ansible_facts.distribution == "Debian" and (ansible_facts.distribution_major_version | int) < 12)
name: Add Docker repo on Ubuntu 20 or before, or Debian 11 or before
block:
- name: Add gpg key
ansible.builtin.shell: curl -fsSL https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg >key && apt-key add key # noqa: command-instead-of-module
- name: Add Docker repo
ansible.builtin.apt_repository:
repo: deb [arch={{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
state: present
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
when: apt_repo is changed
- block:
- name: Prevent service restart

View file

@ -35,5 +35,5 @@
ansible.builtin.service:
name: docker
state: started
ignore_errors: "{{ ansible_virtualization_type in ['docker', 'container', 'containerd'] }}"
ignore_errors: "{{ ansible_facts.virtualization_type in ['docker', 'container', 'containerd'] }}"
when: needs_docker_daemon

View file

@ -42,5 +42,5 @@
ansible.builtin.service:
name: docker
state: started
ignore_errors: "{{ ansible_virtualization_type in ['docker', 'container', 'containerd'] }}"
ignore_errors: "{{ ansible_facts.virtualization_type in ['docker', 'container', 'containerd'] }}"
when: needs_docker_daemon

View file

@ -35,5 +35,5 @@
ansible.builtin.service:
name: docker
state: started
ignore_errors: "{{ ansible_virtualization_type in ['docker', 'container', 'containerd'] }}"
ignore_errors: "{{ ansible_facts.virtualization_type in ['docker', 'container', 'containerd'] }}"
when: needs_docker_daemon

View file

@ -35,5 +35,5 @@
ansible.builtin.service:
name: docker
state: started
ignore_errors: "{{ ansible_virtualization_type in ['docker', 'container', 'containerd'] }}"
ignore_errors: "{{ ansible_facts.virtualization_type in ['docker', 'container', 'containerd'] }}"
when: needs_docker_daemon

View file

@ -23,7 +23,7 @@
block:
- name: Determine whether Docker Daemon needs to be installed
ansible.builtin.set_fact:
needs_docker_daemon: '{{ not ansible_module_running_in_container }}'
needs_docker_daemon: '{{ not ansible_facts.module_running_in_container }}'
- name: Print information
ansible.builtin.debug:
@ -62,7 +62,7 @@
ansible.builtin.service:
name: docker
state: started
when: not ansible_module_running_in_container
when: not ansible_facts.module_running_in_container
- name: Set marker that Docker was already set up
ansible.builtin.file:
@ -70,6 +70,26 @@
state: touch
when: docker_skip_cleanup
- name: Retrieve more information (0/4)
ansible.builtin.command:
cmd: sh -c export
- name: Retrieve more information (1/4)
ansible.builtin.command:
cmd: docker version
- name: Retrieve more information (2/4)
ansible.builtin.command:
cmd: docker info
- name: Retrieve more information (3/4)
ansible.builtin.command:
cmd: docker context ls
- name: Retrieve more information (4/4)
ansible.builtin.command:
cmd: which docker
# Detect docker API version
- name: Check Docker API version
ansible.builtin.command: "docker version -f {% raw %}'{{(index .Server.Components 0).Details.ApiVersion}}'{% endraw %}"