- 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: 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"