Tony Breeds 25727fab47 Add golang based docker compose tool.
This installs the golang based compose (v2) tool.  Also make it the
python based tool optional, but installed by default.

The docker compose v2 tool comes from either:
 - Disrto   : Moby Engine : docker-compose-v2     : Focal -> Oracular
 - Upstream : Docker Inc  : docker-compose-plugin : Trusty -> Noble

With manual checking I can't see any distro older than focal that makes
use of the install-docker role, and all in-tree users pull from
upstream, so I think adding the golang compose tool without checking
the release is safe.

Change-Id: Ib8b5af40e626cd2d1a12b643f348001b9fdf4586
2024-06-19 11:26:26 +10:00

57 lines
1.1 KiB
YAML

- name: Install pre-reqs
package:
name: "{{ item }}"
state: present
with_items:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- apparmor
become: yes
- name: Ensure /etc/apt/keyrings exists
file:
path: /etc/apt/keyrings
state: directory
owner: root
group: root
mode: '0755'
- name: Add docker GPG key
become: yes
copy:
src: docker.gpg.asc
dest: /etc/apt/keyrings/docker.gpg.asc
owner: root
group: root
mode: 0644
register: _update_docker_key
- name: Ensure /etc/apt/sources.list.d exists
file:
path: /etc/apt/sources.list.d
state: directory
owner: root
group: root
mode: '0755'
# TODO(mordred) We should add a proxy cache mirror for this
- name: Add docker apt repo
become: yes
template:
dest: /etc/apt/sources.list.d/docker.list
group: root
mode: 0644
owner: root
src: sources.list.j2
- name: Install docker
become: yes
apt:
name:
- docker-ce
- docker-compose-plugin
state: present
update_cache: yes