Ansible role to deploy a container registry
Go to file
Hervé Beraud a091b9cd21 Remove python-dev from bindep
It is no longer supported by jammy and lead us to the following errors with the announce-release job.

No package matching 'python-dev' is available

Change-Id: I262efa933975966d6e078eff4e5778bc00331a92
2022-11-07 10:48:19 +01:00
defaults Disable docker iptables support 2019-10-03 20:12:48 +01:00
handlers Use ansible_facts 2021-02-22 12:16:33 -07:00
meta Fix CI 2021-02-22 12:16:26 -07:00
molecule Fixing ci 2021-06-28 13:14:27 -06:00
tasks Remove CentOS 7 based job 2022-05-02 11:14:01 +05:30
templates Restore old task for docker-daemon.json 2018-04-16 17:27:04 -07:00
tests Update role name in test.yml 2018-04-16 17:49:34 -07:00
vars docker: add support for additional sockets 2018-05-07 21:49:45 +00:00
zuul.d Remove CentOS 7 based job 2022-05-02 11:14:01 +05:30
.ansible-lint Use ansible-core 2.11 for tests 2021-09-02 17:12:07 +03:00
.gitignore First commit in Gerrit 2018-04-26 09:09:06 -07:00
.gitreview OpenDev Migration Patch 2019-04-19 19:30:05 +00:00
.yamllint Add molecule testing 2019-07-10 18:42:16 -05:00
LICENSE first commit 2018-04-13 13:38:32 -07:00
README.rst Disable docker iptables support 2019-10-03 20:12:48 +01:00
ansible-requirements.txt Use ansible-core 2.11 for tests 2021-09-02 17:12:07 +03:00
ansible.cfg Fix ansible role name in cfg files 2018-04-26 12:33:07 -07:00
bindep.txt Remove python-dev from bindep 2022-11-07 10:48:19 +01:00
molecule-requirements.txt Fixing ci 2021-06-28 13:14:27 -06:00
requirements.txt Use ansible-core 2.11 for tests 2021-09-02 17:12:07 +03:00
setup.cfg setup.cfg: Replace dashes with underscores 2021-05-04 07:53:55 +00:00 Remove CentOS 7 based job 2022-05-02 11:14:01 +05:30
test-requirements.txt Fixup requirements 2021-01-11 14:16:43 -07:00
tox.ini Correct the tox option for skipping sdist generation 2021-06-28 19:37:20 +00:00



A role to deploy a container registry and provide methods to login to it. For now, the role only support Docker Registry v2. The login currently doesn't work with

Role Variables

Variables used for container registry
Name Default Value Description
container_registry_debug false Enable debug option in Docker
container_registry_deploy_docker true Whether or not to deploy Docker
container_registry_deploy_docker_distribution true Whether or not to deploy Docker Distribution
container_registry_deployment_user centos User which needs to manage containers
container_registry_docker_options --log-driver=journald --signature-verification=false --iptables=false --live-restore Options given to Docker configuration
container_registry_docker_disable_iptables false Adds --iptables=false to /etc/sysconfig/docker-network config
container_registry_insecure_registries [] Array of insecure registries
container_registry_network_options [undefined] Docker networking options
container_registry_host localhost Docker registry host
container_registry_port 8787 Docker registry port
container_registry_mirror [undefined] Docker registry mirror
container_registry_storage_options -s overlay2 Docker storage options
container_registry_selinux false Whether or not SElinux is enabled for containers
container_registry_additional_sockets [undefined] Additional sockets for containers
container_registry_skip_reconfiguration false Do not perform container registry reconfiguration if it's already configured
container_registry_logins [] A dictionary containing registries and a username and a password associated with the registry. Example: {'': {'myusername': 'mypassword'}, '': {'otheruser': 'otherpass'}}


  • ansible >= 2.4
  • python >= 2.6



Example Playbooks

Modify Image

The following playbook will deploy a Docker registry:

- hosts: localhost
  become: true
    - container-registry


Apache 2.0

Running local testing

Local testing of this role can be done in a number of ways.

Mimic Zuul

Sometimes its nessisary to setup a test that will mimic what the OpenStack gate will do (Zuul). To run tests that minic the gate, python-virtualenv git, gcc, and ansible are required.

$ sudo yum install python-virtualenv git gcc

Once the packages are installed, create a python virtual environment.

$ python -m virtualenv --system-site-packages ~/test-python
$ ~/test-python/bin/pip install pip setuptools --upgrade

Now install the latest Ansible

$ ~/test-python/bin/pip install ansible

With Ansible installed, activate the virtual environment and run the run-local.yml test playbook.

$ source ~/test-python/bin/activate
(test-python) $ ansible-playbook -i 'localhost,' \
                                 -e "tripleo_src=$(realpath --relative-to="${HOME}" "$(pwd)")" \
                                 -e "ansible_user=${USER}" \
                                 -e "ansible_user_dir=${HOME}" \
                                 -e "ansible_connection=local" \

Running Molecule directly

It is also possible to test this role using molecule directly. When running tests directly it is assumed all of the dependencies are setup and ready to run on the local workstation. When

$ molecule test --all