2025-07-14 21:08:39 -04:00

41 lines
1.1 KiB
YAML

# Use of apt_key plugin is deprecated, see: https://www.jeffgeerling.com/blog/2022/aptkey-deprecated-debianubuntu-how-fix-ansible
- name: Add Docker apt repository key
ansible.builtin.get_url:
url: https://download.docker.com/linux/debian/gpg
dest: /etc/apt/trusted.gpg.d/docker.asc
mode: '0644'
- name: Add Docker Repository
apt_repository:
filename: docker
repo: deb https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
state: present
- name: Ensure docker packages are installed
apt:
state: present
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
- name: "Copy docker helper scripts to /usr/local/bin: ({{ docker_install_extra_scripts | ternary('present', 'absent') }})"
ansible.builtin.copy:
src: "{{ item }}"
dest: /usr/local/bin/
mode: '0755'
with_fileglob:
- files/*
when: "docker_install_extra_scripts"
- name: Ensure extra packages are installed
apt:
state: present
name:
- jq # For nip support
when: "docker_install_extra_scripts"