summaryrefslogtreecommitdiff
path: root/roles/docker/registry/tasks/main.yml
blob: d99a28d3299a062275f9fa7a7b52b299ae20544d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- name: prepare storage volume for /var/lib/docker-registry
  when: docker_registry_storage is defined
  vars:
    storage_volume: "{{ docker_registry_storage | combine({'dest': '/var/lib/docker-registry'}) }}"
  include_role:
    name: "storage/{{ docker_registry_storage.type }}/volume"

- name: install registry package
  apt:
    name: docker-registry
    state: present

- name: set up tls config
  when: docker_registry_http_tls is defined
  vars:
    x509_certificate_name: "docker-registry"
    x509_certificate_hostnames: "{{ docker_registry_http_hostnames }}"
    x509_certificate_config: "{{ docker_registry_http_tls.certificate_config }}"
    x509_certificate_restart_services:
    - docker-registry
  include_role:
    name: "x509/{{ docker_registry_http_tls.certificate_provider }}/cert"

- name: install config
  template:
    src: config.yml.j2
    dest: /etc/docker/registry/config.yml
    mode: 0640
    group: docker-registry
  notify: restart docker-registry