forked from openstack-k8s-operators/ci-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out content-provider reproducer
It may happen people want to run the content-provider automatically, but the actual job manually. It may also happen the content-provider just passes, but the subsequent "job" run fails - and we of course don't want to re-run the content-provider.
- Loading branch information
1 parent
2452763
commit 69a9eb1
Showing
6 changed files
with
145 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ bmc | |
bmh | ||
bmo | ||
bool | ||
booleans | ||
boostrap | ||
bootmacaddress | ||
bootmode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
--- | ||
{% raw %} | ||
- name: Load parameters and expose needed data | ||
hosts: localhost | ||
gather_facts: true | ||
tasks: | ||
- name: Load interfaces-info.yml | ||
ansible.builtin.include_vars: | ||
file: "/etc/ci/env/networking-environment-definition.yml" | ||
name: _net_env | ||
|
||
- name: Set cifmw_rp_registry_ip | ||
ansible.builtin.set_fact: | ||
cacheable: true | ||
cifmw_rp_registry_ip: >- | ||
{{ _net_env.instances['controller-0'].networks.ctlplane.ip_v4 }} | ||
|
||
|
||
- name: Configure OCPs for insecure registry | ||
hosts: ocps | ||
vars: | ||
content_provider_registry_ip: "{{ hostvars['localhost']['cifmw_rp_registry_ip'] }}" | ||
tasks: | ||
- name: Wait for CRC to be ready | ||
register: wait_crc | ||
ansible.builtin.command: >- | ||
oc login api.crc.testing:6443 | ||
-u kubeadmin | ||
-p 12345678 | ||
--insecure-skip-tls-verify=true | ||
retries: 60 | ||
delay: 10 | ||
until: | ||
- wait_crc is defined | ||
- wait_crc.rc is defined | ||
- wait_crc.rc == 0 | ||
|
||
- name: Set insecure registry on crc node | ||
ansible.builtin.import_tasks: ci/playbooks/tasks/set_crc_insecure_registry.yml | ||
{% endraw %} | ||
|
||
- name: "Content Provider" | ||
hosts: localhost | ||
gather_facts: false | ||
vars: | ||
cifmw_rp_registry_firewall: false | ||
job_id: "{{ job_id }}" | ||
tasks: | ||
{% raw %} | ||
- name: Load env variables | ||
ansible.builtin.include_vars: | ||
file: "{{ item }}" | ||
loop: | ||
- "{{ ansible_user_dir }}/{{ job_id }}-params/zuul-params.yml" | ||
- "./scenarios/centos-9/base.yml" | ||
- "./scenarios/centos-9/content_provider.yml" | ||
|
||
- name: Install necessary tools | ||
ansible.builtin.import_role: | ||
name: install_yamls_makes | ||
tasks_from: make_download_tools | ||
|
||
- name: Deploy registry | ||
ansible.builtin.import_role: | ||
name: registry_deploy | ||
|
||
# Imported from the ci/playbooks/content_provider/content_provider.yml play | ||
# Ensure we get consistent name for the operator, linked to | ||
# https://github.com/openstack-k8s-operators/ci-framework/pull/621 | ||
- name: Set var for cifmw_operator_build_operators var | ||
when: | ||
- zuul is defined | ||
- "'project' in zuul" | ||
- "'short_name' in zuul.project" | ||
ansible.builtin.set_fact: | ||
cifmw_operator_build_operators: | ||
- name: "openstack-operator" | ||
src: "~/src/github.com/{{ cifmw_operator_build_org }}/openstack-operator" | ||
image_base: >- | ||
{{ zuul.project.short_name | split('-') | reject('search','operator') | join('-') }} | ||
|
||
- name: Build Operators | ||
ansible.builtin.include_role: | ||
name: operator_build | ||
|
||
- name: Get the containers list from container registry | ||
ansible.builtin.uri: | ||
url: "http://{{ cifmw_rp_registry_ip }}:5001/v2/_catalog" | ||
return_content: true | ||
register: cp_imgs | ||
|
||
- name: Add the container list to file | ||
ansible.builtin.copy: | ||
content: "{{ cp_imgs.content }}" | ||
dest: "{{ ansible_user_dir }}/local_registry.log" | ||
mode: "0644" | ||
|
||
- name: Output needed content into consumable environment | ||
ansible.builtin.copy: | ||
dest: "{{ ansible_user_dir }}/{{ job_id }}-params/content-provider.yml" | ||
content: |- | ||
{{ | ||
{'cifmw_operator_build_output': cifmw_operator_build_output, | ||
'content_provider_registry_ip': cifmw_rp_registry_ip | ||
} | to_nice_yaml | ||
}} | ||
{% endraw %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters