
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
87 lines
2.3 KiB
YAML
87 lines
2.3 KiB
YAML
- name: Create docker directory
|
|
become: yes
|
|
file:
|
|
state: directory
|
|
path: /etc/docker
|
|
|
|
- name: Install docker-ce from upstream
|
|
include_tasks: upstream.yaml
|
|
when: use_upstream_docker|bool
|
|
|
|
- name: Install docker-engine from distro
|
|
include_tasks: distro.yaml
|
|
when: not use_upstream_docker|bool
|
|
|
|
- name: reset ssh connection to pick up docker group
|
|
meta: reset_connection
|
|
|
|
# We install docker-compose from pypi to get features like
|
|
# stop_grace_period.
|
|
|
|
# On arm64 we need build-essential, python3-dev, libffi-dev, and
|
|
# libssl-dev because wheels don't exist for all the things on arm64.
|
|
# Similarly for Xenial while we have it, some things (cffi) have
|
|
# stopped providing Python 3.5 wheels
|
|
- name: Install arm64 dev pacakges
|
|
when: >
|
|
ansible_architecture == 'aarch64' or
|
|
ansible_distribution_release == 'xenial'
|
|
package:
|
|
name:
|
|
- build-essential
|
|
- python3-dev
|
|
- libffi-dev
|
|
- libssl-dev
|
|
state: present
|
|
|
|
- name: Install python docker-compose if needed
|
|
when: with_python_compose|bool
|
|
block:
|
|
- name: ensure pip3 is installed
|
|
include_role:
|
|
name: pip3
|
|
|
|
- name: Install docker-compose
|
|
pip:
|
|
name:
|
|
# The explicit pin of requests is a temporary workaround to getting
|
|
# docker-compose functioning again after requests and urllib3 updates.
|
|
# Unfortunately python docker-compose is abandonware and we will need
|
|
# to migrate to the new docker plugin system or distro packages, but
|
|
# until then this is a quick workaround that will get things moving
|
|
# again.
|
|
# The explicit pin of docker is required as py docker 7.0 introduced
|
|
# incompatibilities with python docker-compose.
|
|
- requests<2.30.0
|
|
- docker<7.0.0
|
|
- docker-compose
|
|
state: present
|
|
executable: pip3
|
|
|
|
- name: Install rsyslog redirector for container tags
|
|
copy:
|
|
src: '10-docker.conf'
|
|
dest: /etc/rsyslog.d/
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify:
|
|
- Restart rsyslog
|
|
|
|
- name: Ensure rsyslog restarted now
|
|
meta: flush_handlers
|
|
|
|
- name: Create container log directories
|
|
file:
|
|
state: directory
|
|
path: /var/log/containers/
|
|
owner: syslog
|
|
group: adm
|
|
mode: 0775
|
|
|
|
- name: Install log rotation for docker files
|
|
include_role:
|
|
name: logrotate
|
|
vars:
|
|
logrotate_file_name: '/var/log/containers/*.log'
|