Skip to main content

ansible-container-registry - Ansible role to deploy a container registry

Project description

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 hub.docker.com.

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: {‘docker.io’: {‘myusername’: ‘mypassword’}, ‘registry.example.com:8787’: {‘otheruser’: ‘otherpass’}}

Requirements

  • ansible >= 2.4

  • python >= 2.6

Dependencies

None

Example Playbooks

Modify Image

The following playbook will deploy a Docker registry:

- hosts: localhost
  become: true
  roles:
    - container-registry

License

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" \
                                 zuul.d/playbooks/run-local.yml

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ansible-role-container-registry-1.3.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

ansible_role_container_registry-1.3.0-py2.py3-none-any.whl (18.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ansible-role-container-registry-1.3.0.tar.gz.

File metadata

  • Download URL: ansible-role-container-registry-1.3.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for ansible-role-container-registry-1.3.0.tar.gz
Algorithm Hash digest
SHA256 a38f526397623504f76196d5cf94d7360b330727f33240e02bd7a3b3434d55f4
MD5 d8776f97dca20ca95b65e32ff3e51ca4
BLAKE2b-256 413d7101f96249ff908e71dca2731cc1cdbe1ce95f36e6859fa116aeca1626af

See more details on using hashes here.

Provenance

File details

Details for the file ansible_role_container_registry-1.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ansible_role_container_registry-1.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

File hashes

Hashes for ansible_role_container_registry-1.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a033f29ce058328d54b762d0ca597327852f934acc68cf059facbede7303dc0e
MD5 9fb618d04c54e4ecbabb4c8cf77c4630
BLAKE2b-256 4773b03b2239ba6a8dcfae76400857ce6beb2fbbe7d239359c323a20387bad83

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page