ansible-container-registry - Ansible角色用于部署容器注册表
项目描述
一个用于部署容器注册表并提供登录方法的角色。目前,该角色仅支持Docker Registry v2。登录目前无法与hub.docker.com一起使用。
角色变量
名称 |
默认值 |
描述 |
---|---|---|
container_registry_debug |
false |
在Docker中启用调试选项 |
container_registry_deploy_docker |
true |
是否部署Docker |
container_registry_deploy_docker_distribution |
true |
是否部署Docker Distribution |
container_registry_deployment_user |
centos |
需要管理容器的用户 |
container_registry_docker_options |
–log-driver=journald –signature-verification=false –iptables=false –live-restore |
给Docker配置的选项 |
container_registry_docker_disable_iptables |
false |
将–iptables=false添加到 /etc/sysconfig/docker-network 配置 |
container_registry_insecure_registries |
[] |
不安全注册表数组 |
container_registry_network_options |
[未定义] |
Docker网络选项 |
container_registry_host |
localhost |
Docker注册表主机 |
container_registry_port |
8787 |
Docker注册表端口 |
container_registry_mirror |
[未定义] |
Docker注册表镜像 |
container_registry_storage_options |
-s overlay2 |
Docker存储选项 |
container_registry_selinux |
false |
是否为容器启用SElinux |
container_registry_additional_sockets |
[未定义] |
容器的附加套接字 |
container_registry_skip_reconfiguration |
false |
如果已配置,则不执行容器注册表重新配置 |
container_registry_logins |
[] |
包含注册表以及与注册表相关联的用户名和密码的字典。例如:{‘docker.io’: {‘myusername’: ‘mypassword’}, ‘registry.example.com:8787’: {‘otheruser’: ‘otherpass’}} |
需求
ansible >= 2.4
python >= 2.6
依赖项
无
示例剧本
修改镜像
以下剧本将部署一个Docker注册表
- hosts: localhost
become: true
roles:
- container-registry
许可证
Apache 2.0
本地测试运行
可以使用多种方式在本地测试此角色的功能。
模拟Zuul
有时需要设置一个测试,以模拟OpenStack门(Zuul)的操作。要运行模拟门的测试,需要python-virtualenv
、git
、gcc
和ansible
。
$ sudo yum install python-virtualenv git gcc
一旦安装了包,创建一个Python虚拟环境。
$ python -m virtualenv --system-site-packages ~/test-python
$ ~/test-python/bin/pip install pip setuptools --upgrade
现在安装最新的Ansible
$ ~/test-python/bin/pip install ansible
安装Ansible后,激活虚拟环境并运行run-local.yml
测试剧本。
$ 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
直接运行Molecule
也可以使用Molecule直接测试此角色。当直接运行测试时,假设所有依赖都已设置并准备好在本地工作站上运行。
$ molecule test --all
项目详情
哈希值 for ansible-role-container-registry-1.4.0.tar.gz
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 320e95a39cf6ae46cf608909d7e6810a52952778722402bdc38abba4b9979dea |
|
MD5 | 6e14c9ab6168cc84d0e1be8a59a0653c |
|
BLAKE2b-256 | 3f61b91ff2fc5bbbd9258dcfd964559b512197a93964f49d0f8923b57af8c109 |
哈希值 for ansible_role_container_registry-1.4.0-py2.py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0b0cdd2db2b82268ee66179f63227aa7d1246b0d2ebcc7306b4baa831e87ed2b |
|
MD5 | 5061a7b8557acaa728d431766a518e7e |
|
BLAKE2b-256 | 158b11a32d52514205554b3a9b224dc21cfbe70d5fa24420c4fd8b7842524b8a |