Merge "Use consistent registry type var name across roles"
This commit is contained in:
commit
9edd78d72a
@ -39,14 +39,19 @@ communicate to using arguments below.
|
|||||||
`<https://docs.quay.io/api/>`__
|
`<https://docs.quay.io/api/>`__
|
||||||
* **docker.io** : Username and password
|
* **docker.io** : Username and password
|
||||||
|
|
||||||
|
You can specify the registry type explicitly via the ``type``
|
||||||
|
attribute, but it will be inferred for quay.io and docker.io.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
container_registry_credentials:
|
container_registry_credentials:
|
||||||
quay.io:
|
quay.io:
|
||||||
|
type: 'quay'
|
||||||
api_token: 'abcd1234'
|
api_token: 'abcd1234'
|
||||||
docker.io:
|
docker.io:
|
||||||
|
type: 'docker'
|
||||||
username: 'username'
|
username: 'username'
|
||||||
password: 'password'
|
password: 'password'
|
||||||
|
|
||||||
@ -74,16 +79,6 @@ communicate to using arguments below.
|
|||||||
:zuul:rolevar:`remove-registry-tag.remove_registry_tag_regex`
|
:zuul:rolevar:`remove-registry-tag.remove_registry_tag_regex`
|
||||||
last-modified timestamp must exceed to be removed.
|
last-modified timestamp must exceed to be removed.
|
||||||
|
|
||||||
.. zuul:rolevar:: remove_registry_tag_api_type
|
|
||||||
:type: string
|
|
||||||
|
|
||||||
Optional. By default the role will guess the API type from the
|
|
||||||
repository name. However, if you need to override this choice
|
|
||||||
specify one of:
|
|
||||||
|
|
||||||
* quay
|
|
||||||
* docker
|
|
||||||
|
|
||||||
.. zuul:rolevar:: remove_registry_tag_api_url
|
.. zuul:rolevar:: remove_registry_tag_api_url
|
||||||
:type: string
|
:type: string
|
||||||
|
|
||||||
|
@ -13,15 +13,31 @@
|
|||||||
_registry: "{{ (remove_registry_tag_repository | split('/', 1)).0 }}"
|
_registry: "{{ (remove_registry_tag_repository | split('/', 1)).0 }}"
|
||||||
_repopath: "{{ (remove_registry_tag_repository | split('/', 1)).1 }}"
|
_repopath: "{{ (remove_registry_tag_repository | split('/', 1)).1 }}"
|
||||||
|
|
||||||
|
- name: Verify registry names
|
||||||
|
when: |
|
||||||
|
container_registry_credentials is defined
|
||||||
|
and _registry not in container_registry_credentials
|
||||||
|
fail:
|
||||||
|
msg: "{{ _registry }} credentials not found"
|
||||||
|
|
||||||
- name: Autoprobe for quay.io
|
- name: Autoprobe for quay.io
|
||||||
when: remove_registry_tag_api_type is not defined and "quay.io" in _registry
|
when:
|
||||||
|
- container_registry_credentials[_registry].type is not defined
|
||||||
|
- '"quay.io" in _registry'
|
||||||
set_fact:
|
set_fact:
|
||||||
remove_registry_tag_api_type: "quay"
|
registry_type: "quay"
|
||||||
|
|
||||||
- name: Autoprobe for docker
|
- name: Autoprobe for docker
|
||||||
when: remove_registry_tag_api_type is not defined and "docker.io" in _registry
|
when:
|
||||||
|
- container_registry_credentials[_registry].type is not defined
|
||||||
|
- '"docker.io" in _registry'
|
||||||
set_fact:
|
set_fact:
|
||||||
remove_registry_tag_api_type: "docker"
|
registry_type: "docker"
|
||||||
|
|
||||||
|
- name: Use explicit registry type if set
|
||||||
|
when: container_registry_credentials[_registry].type is defined
|
||||||
|
set_fact:
|
||||||
|
registry_type: container_registry_credentials[_registry].type
|
||||||
|
|
||||||
- name: Remove tags
|
- name: Remove tags
|
||||||
include_tasks: '{{ remove_registry_tag_api_type }}.yaml'
|
include_tasks: '{{ registry_type }}.yaml'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user