Ansible role to deploy a container registry
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

# tasks file for ansible-role-container-registry
- name: ensure docker-distribution is installed
name: docker-distribution
state: present
become: true
register: _distro_install
- name: manage /etc/docker-distribution/registry/config.yml
src: docker-distribution-config.yml.j2
dest: /etc/docker-distribution/registry/config.yml
mode: '0644'
become: true
register: _distro_config
notify: restart docker-distribution service
- name: Handle docker-distribution restart
become: true
when: _distro_install is changed or _distro_config is changed
- name: Reload systemd
daemon_reload: yes
become: true
- name: Reload docker-distribution
enabled: true
name: docker-distribution
state: restarted
become: true
# NOTE(bogdando): import caveats
- name: Wait for registry
# Just checking API version should be fine
url: "http://{{ container_registry_host }}:{{ container_registry_port }}/v2/"
return_content: yes
register: registry_status
retries: 10
delay: 5
until: "registry_status.status|int == 200 and 'OK' in registry_status.msg"