--- - name: Bootstrap playbook hosts: "{{ cifmw_target_host | default('localhost') }}" gather_facts: true tasks: - name: Run bootstrap ansible.builtin.import_role: name: cifmw_setup tasks_from: bootstrap.yml - hosts: "{{ cifmw_target_host | default('localhost') }}" name: Install dev tools tasks: - name: Assert that operator_name is set ansible.builtin.assert: that: - operator_name is defined - name: Download install_yamls deps ansible.builtin.include_role: name: 'install_yamls_makes' tasks_from: 'make_download_tools' - name: Run pre_infra hooks vars: step: pre_infra ansible.builtin.import_role: name: run_hook - name: Prepare host virtualization hosts: "{{ ('virthosts' in groups) | ternary('virthosts', cifmw_target_host | default('localhost') ) }}" tasks: - name: Run prepare host virtualization vars: step: pre_infra ansible.builtin.import_role: name: cifmw_setup tasks_from: host_virtualization.yml tags: - infra - name: Build dataset hook hosts: "{{ cifmw_target_host | default('localhost') }}" gather_facts: false connection: local tasks: - name: Prepare the platform vars: step: pre_infra ansible.builtin.import_role: name: cifmw_setup tasks_from: infra.yml tags: - infra - name: Load parameters ansible.builtin.include_vars: dir: "{{ item }}" loop: - "{{ cifmw_basedir }}/artifacts/parameters" - "/etc/ci/env" loop_control: label: "{{ item }}" - name: set facts for further usage within the framework vars: _crc_hostname: "{{ cifmw_crc_hostname | default('crc') }}" block: - name: Ensure that the isolated net was configured for crc ansible.builtin.assert: that: - crc_ci_bootstrap_networks_out is defined - crc_ci_bootstrap_networks_out[_crc_hostname] is defined - crc_ci_bootstrap_networks_out[_crc_hostname]['default'] is defined - name: Set facts for further usage within the framework ansible.builtin.set_fact: cifmw_edpm_prepare_extra_vars: NNCP_INTERFACE: "{{ crc_ci_bootstrap_networks_out.crc.default.iface }}" NETWORK_MTU: "{{ crc_ci_bootstrap_networks_out.crc.default.mtu }}" NNCP_DNS_SERVER: >- {{ cifmw_nncp_dns_server | default(crc_ci_bootstrap_networks_out[_crc_hostname].default.ip) | split('/') | first }} - hosts: "{{ cifmw_target_host | default('localhost') }}" name: Deploy Openstack Operators tasks: - name: Use the locally built operators if any ansible.builtin.set_fact: _local_operators_indexes: >- {{ _local_operators_indexes|default({}) | combine({ item.key.split('-')[0]|upper+'_IMG': cifmw_operator_build_output['operators'][item.key].image_catalog}) }} loop: "{{ cifmw_operator_build_output['operators'] | dict2items }}" when: - cifmw_operator_build_output is defined - "'operators' in cifmw_operator_build_output" - name: Set install_yamls Makefile environment variables vars: operators_build_output: "{{ (cifmw_operator_build_output | default({'operators':{}})).operators }}" _openstack_operator_images: OPENSTACK_IMG: "{{ cifmw_operator_build_output.operators['openstack-operator']['image_catalog'] | default(omit) }}" OPENSTACK_BUNDLE_IMG: "{{ cifmw_operator_build_output.operators['openstack-operator']['image_bundle'] | default(omit) }}" ansible.builtin.set_fact: cifmw_edpm_prepare_common_env: >- {{ cifmw_install_yamls_environment | combine({'PATH': cifmw_path}) | combine(cifmw_edpm_prepare_extra_vars | default({})) }} cifmw_edpm_prepare_operators_build_output: "{{ operators_build_output }}" cifmw_edpm_prepare_make_openstack_env: "{{ _local_operators_indexes | combine(_openstack_operator_images) }}" - name: Deploy openstack Operators environment: KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" block: - name: detect if openstack operator is installed ansible.builtin.command: cmd: "oc get sub --ignore-not-found=true -n openstack-operators -o name openstack-operator" ignore_errors: true register: openstack_operator_subscription - name: Install openstack operator and wait for the csv to succeed when: openstack_operator_subscription.stdout == "" vars: make_openstack_init_env: "{{ cifmw_edpm_prepare_common_env | combine(cifmw_edpm_prepare_make_openstack_env) }}" make_openstack_init_dryrun: "{{ cifmw_edpm_prepare_dry_run }}" ansible.builtin.include_role: name: 'install_yamls_makes' tasks_from: 'make_openstack_init' - name: Run hooks after installing openstack vars: step: post_install_operators_kuttl_from_operator ansible.builtin.include_role: name: run_hook - name: install kuttl test_suite dependencies vars: project_name: "github.com/openstack-k8s-operators/{{ operator_name }}" operator_basedir: >- {{ zuul.projects[project_name].src_dir }} ansible.builtin.command: cmd: make kuttl-test-prep chdir: "{{ ansible_user_dir }}/{{ operator_basedir }}" register: result until: result.rc == 0 retries: 3 delay: 10 changed_when: true