system-config/playbooks/roles/install-docker/tasks/main.yaml
Ian Wienand cc4903bd5f install-docker: install build-essential for cffi on Xenial
cffi has stopped providing Python 3.5 wheels; this may be a feature or
a bug [1].  In the mean time, install build-essential, etc. so we can
build at install time.

[1] https://foss.heptapod.net/pypy/cffi/-/issues/503

Change-Id: Iece31a18048fd40472cfddd5262576ca150a86ac
2021-07-12 14:49:17 +10:00

73 lines
1.6 KiB
YAML

- name: Create docker directory
become: yes
file:
state: directory
path: /etc/docker
- name: Install docker-ce from upstream
include: upstream.yaml
when: use_upstream_docker|bool
- name: Install docker-engine from distro
include: 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: ensure pip3 is installed
include_role:
name: pip3
- name: Install docker-compose
pip:
name: 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'