Merge "Add docker login support"
This commit is contained in:
commit
54526ccde7
|
@ -57,6 +57,10 @@ Role Variables
|
|||
* - `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
|
||||
------------
|
||||
|
|
|
@ -14,3 +14,4 @@ container_registry_storage_options: '-s overlay2'
|
|||
container_registry_selinux: false
|
||||
container_registry_additional_sockets: []
|
||||
container_registry_skip_reconfiguration: false
|
||||
container_registry_logins: {}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# tasks file for ansible-role-container-registry
|
||||
|
||||
- name: perform docker login
|
||||
become: true
|
||||
docker_login:
|
||||
username: "{{ lookup('dict', item.value).key }}"
|
||||
password: "{{ lookup('dict', item.value).value }}"
|
||||
registry: "{{ item.key }}"
|
||||
loop: "{{ lookup('dict', container_registry_logins) }}"
|
||||
when: container_registry_logins | length > 0
|
||||
|
Loading…
Reference in New Issue