43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
---
|
|
- hosts: all
|
|
tasks:
|
|
|
|
- when: registry_ip_address_branch is defined
|
|
block:
|
|
|
|
# Check if we have built something in content provider.
|
|
# If we did - create a gating-repo pointing to content provider. The
|
|
# port 8766 will be opened.
|
|
# If we didn't build, port 8766 will be closed - skip gating-repo creating.
|
|
- name: Check if we have a repo
|
|
wait_for:
|
|
timeout: 2
|
|
port: 8766
|
|
host: '{{ registry_ip_address_branch[item.key] }}'
|
|
register: waitfor
|
|
ignore_errors: true
|
|
loop: '{{ registry_ip_address_branch | dict2items }}'
|
|
|
|
# create the gating repo for any branch defined in
|
|
# registry_ip_address_branch.
|
|
# Allow the release config to appropriately enable the gating repo
|
|
# for the branch in use.
|
|
# related-review: https://review.opendev.org/ 763747
|
|
# LP: https://launchpad.net/bugs/1907122
|
|
- name: Create a repo if got registry IP from Zuul
|
|
become: true
|
|
when:
|
|
- server is not failed
|
|
copy:
|
|
dest: /etc/yum.repos.d/gating-repo-{{ server.item.key }}.repo
|
|
content: |
|
|
[gating-repo-{{ server.item.key }}]
|
|
name=Gating repository
|
|
baseurl=http://{{ server.item.value }}:8766/
|
|
enabled=1
|
|
gpgcheck=0
|
|
priority=1
|
|
loop: "{{ waitfor.results }}"
|
|
loop_control:
|
|
loop_var: server
|