--- {% 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: "Operator Content Provider" hosts: localhost gather_facts: false vars: cifmw_rp_registry_firewall: false job_id: "{{ job_id }}" _cifmw_reproducer_framework_location: "{{ _cifmw_reproducer_framework_location }}" tasks: {% if operator_content_provider | default(false) | bool %} {% 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 %} {% endif %} {% if openstack_content_provider | default(false) | bool %} {% raw %} - name: Run tcib playbook environment: ANSIBLE_LOG_PATH: "~/ansible-openstack-content-provider-{{job_id }}.log" ansible.builtin.command: chdir: "{{ _cifmw_reproducer_framework_location }}" cmd: >- ansible-playbook ci/playbooks/tcib/tcib.yml -i "~/ci-framework-data/artifacts/zuul_inventory.yml" -e @./scenarios/centos-9/base.yml -e @./scenarios/centos-9/tcib.yml -e cifmw_zuul_target_host=controller-0 -e "cifmw_build_containers_registry_namespace="{{ cifmw_update_containers_org | default(cifmw_default_container_image_namespace) }}"" -e "cifmw_build_containers_image_tag="{{ cifmw_update_containers_tag | default(cifmw_default_container_image_tag) }}"" -e "cifmw_rp_registry_ip="{{ hostvars['localhost']['cifmw_rp_registry_ip'] }}"" -e "@{{ ansible_user_dir }}/ci-framework-data/parameters/reproducer-variables.yml" -e "@~/{{ job_id }}-params/zuul-params.yml" -e "cifmw_rp_registry_port=5001" --skip-tags build_openstack_packages - name: Output needed content into consumable environment ansible.builtin.copy: dest: "{{ ansible_user_dir }}/{{ job_id }}-params/content-provider.yml" content: |- {{ {'content_provider_registry_ip': cifmw_rp_registry_ip, 'cifmw_update_containers_registry': '{{ content_provider_registry_ip }}:5001' } | to_nice_yaml }} - name: Create symlink of content provider var file ansible.builtin.file: src: "{{ ansible_user_dir }}/{{ job_id }}-params/content-provider.yml" dest: "{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/content-provider.yml" state: link {% endraw %} {% endif %}