system-config/playbooks/roles/registry/tasks/main.yaml
Clark Boylan 3deef00ba9 Manage insecure-ci-registry cert with LE
This adds a new handler to restart the zuul registry to pick up the new
cert. We may want to consider updating zuul registry to accept a reload
of ssl config without restarting the service.

Depends-On: https://review.opendev.org/702050
Change-Id: I23f6bea68285bc7cb0d12224235eaa16f0d07986
2020-01-13 15:20:20 -08:00

45 lines
1.2 KiB
YAML

- name: Synchronize docker-compose directory
synchronize:
src: registry-docker/
dest: /etc/registry-docker/
- name: Ensure registry volume directories exists
file:
state: directory
path: "/var/registry/{{ item }}"
loop:
- certs
- conf
- etc
- name: Write clouds.yaml
template:
src: clouds.yaml.j2
dest: /var/registry/etc/clouds.yaml
- name: Write registry config
template:
src: registry.yaml.j2
dest: /var/registry/conf/registry.yaml
- name: Install docker-compose
package:
name:
- docker-compose
state: present
- name: Run docker-compose pull
shell:
cmd: docker-compose pull
chdir: /etc/registry-docker/
- name: Run docker-compose up
shell:
cmd: docker-compose up -d
chdir: /etc/registry-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f
# Temporarily disable to aid debug of mysteriously absent blobs
# -corvus 2019-10-09
# - name: Install cron to garbage collect the registry daily
# cron:
# name: "docker registry garbage-collect"
# minute: "0"
# hour: "0"
# job: "/usr/bin/docker exec registrydocker_registry_1 zuul-registry prune"