diff --git a/ansible/group_vars/all/docker-registry b/ansible/group_vars/all/docker-registry index 5309e9543..5ee86f554 100644 --- a/ansible/group_vars/all/docker-registry +++ b/ansible/group_vars/all/docker-registry @@ -18,3 +18,6 @@ docker_registry_env: {} # NOTE: This is set to 4000 rather than the default of 5000 to avoid clashing # with keystone. docker_registry_port: 4000 + +# Name or path to use as the volume for the docker registry. +docker_registry_datadir_volume: docker_registry diff --git a/ansible/roles/docker-registry/README.md b/ansible/roles/docker-registry/README.md index b0b43328e..9f61af298 100644 --- a/ansible/roles/docker-registry/README.md +++ b/ansible/roles/docker-registry/README.md @@ -25,6 +25,8 @@ to ``true``. ``docker_registry_restart_policy``: Docker restart policy for ``docker_registry`` container. Defaults to ``unless-stopped``. ``docker_registry_restart_retries``: Number of Docker restarts. Defaults to 10. +``docker_registry_datadir_volume``: The name or path to use for the docker +volume that backs the registry. Defaults to ``docker_registry``. Dependencies ------------ diff --git a/ansible/roles/docker-registry/defaults/main.yml b/ansible/roles/docker-registry/defaults/main.yml index b56be7dec..2cb859c62 100644 --- a/ansible/roles/docker-registry/defaults/main.yml +++ b/ansible/roles/docker-registry/defaults/main.yml @@ -28,11 +28,15 @@ docker_registry_services: - "{{ docker_registry_port }}:5000" volumes: - "/etc/localtime:/etc/localtime:ro" - - "docker_registry:/var/lib/registry" + - "{{ docker_registry_datadir_volume }}:/var/lib/registry" # The port on which the docker registry server should listen. docker_registry_port: 5000 +# The name or path to use for the docker volume that backs the registry. +# Defaults to ``docker_registry``. +docker_registry_datadir_volume: docker_registry + #################### # Docker #################### diff --git a/releasenotes/notes/add-variable-docker-registry-datadir-volume-a5ec931a5eb2c59d.yaml b/releasenotes/notes/add-variable-docker-registry-datadir-volume-a5ec931a5eb2c59d.yaml new file mode 100644 index 000000000..eaab2402f --- /dev/null +++ b/releasenotes/notes/add-variable-docker-registry-datadir-volume-a5ec931a5eb2c59d.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds the variable, ``docker_registry_datadir_volume``. This allows you to + configure the name or path of the docker volume used for the docker registry.