Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion ci/playbooks/edpm/update.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# When cifmw_run_on_zuul_host is true, this playbook directly imports update-edpm.yml
# instead of running nested ansible-playbook commands.
- name: "Run ci/playbooks/edpm/update.yml"
hosts: "{{ cifmw_zuul_target_host | default('all') }}"
gather_facts: true
Expand All @@ -15,7 +17,45 @@
path: "{{ ansible_user_dir }}/ci-framework-data/artifacts/edpm-ansible.yml"
register: edpm_file

- name: Run Podified EDPM update
- name: Load parameters for direct execution
when: cifmw_run_on_zuul_host | default(false) | bool
block:
- name: Load group vars
ansible.builtin.include_vars:
file: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/group_vars/all.yml"
ignore_errors: true

- name: Load scenario files
ansible.builtin.include_vars:
file: "{{ item }}"
loop:
- "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/scenarios/centos-9/base.yml"
- "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/scenarios/centos-9/edpm_ci.yml"
ignore_errors: true

- name: Load edpm-ansible.yml if exists
when: edpm_file.stat.exists
ansible.builtin.include_vars:
file: "{{ ansible_user_dir }}/ci-framework-data/artifacts/edpm-ansible.yml"
ignore_errors: true

- name: Load all parameters from parameters directory
vars:
provided_dir: "{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters"
ansible.builtin.include_role:
name: cifmw_helpers
tasks_from: var_dir.yml

- name: Set update_playbook_run fact
ansible.builtin.set_fact:
update_playbook_run: true

- name: Directly import update-edpm.yml playbook (zuul host execution)
when: cifmw_run_on_zuul_host | default(false) | bool
ansible.builtin.import_playbook: update-edpm.yml

- name: Run Podified EDPM update via nested ansible-playbook (controller-0 execution)
when: not (cifmw_run_on_zuul_host | default(false) | bool)
ansible.builtin.command:
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework"
cmd: >-
Expand Down
116 changes: 78 additions & 38 deletions ci/playbooks/edpm_baremetal_update/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,44 +84,84 @@

- name: Override operator build output with pre-update index image for Phase 1
ansible.builtin.set_fact:
cifmw_operator_build_output_pre_update: >-
{{
{
'cifmw_operator_build_output': {
'operators': {
'openstack-operator': {
'image_catalog': cifmw_minor_update_pre_update_index_image
}
}
}
}
}}
cifmw_operator_build_output:
operators:
openstack-operator:
image_catalog: "{{ cifmw_minor_update_pre_update_index_image }}"

- name: Phase 1 - Deploy with pre-update index image using deploy-edpm.yml
- name: Load parameters for direct execution
block:
- name: Write pre-update operator build output to temporary file
ansible.builtin.copy:
dest: "{{ ansible_user_dir }}/ci-framework-data/artifacts/operator_build_output_pre_update.yml"
content: "{{ cifmw_operator_build_output_pre_update | to_nice_yaml }}"
mode: "0644"
- name: Load group vars
block:
- name: Read group vars file
ansible.builtin.slurp:
src: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/group_vars/all.yml"
delegate_to: localhost
register: _group_vars_content

- name: Set group vars as facts
when: "'content' in _group_vars_content"
ansible.builtin.set_fact:
"{{ item.key }}": "{{ item.value }}"
cacheable: true
loop: "{{ _group_vars_content['content'] | b64decode | from_yaml | dict2items }}"
loop_control:
loop_var: item

- name: Load scenario files
loop:
- "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/scenarios/centos-9/base.yml"
- "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/scenarios/centos-9/edpm_baremetal_deployment_ci.yml"
loop_control:
loop_var: scenario_file
block:
- name: Read scenario file
ansible.builtin.slurp:
src: "{{ scenario_file }}"
delegate_to: localhost
register: _scenario_file

- name: Set scenario vars as facts
when: "'content' in _scenario_file"
ansible.builtin.set_fact:
"{{ fact_item.key }}": "{{ fact_item.value }}"
cacheable: true
loop: "{{ _scenario_file['content'] | b64decode | from_yaml | dict2items }}"
loop_control:
loop_var: fact_item

- name: Load edpm-ansible.yml if exists
when: edpm_file.stat.exists
block:
- name: Read edpm-ansible.yml file
ansible.builtin.slurp:
src: "{{ ansible_user_dir }}/ci-framework-data/artifacts/edpm-ansible.yml"
delegate_to: localhost
register: _edpm_content

- name: Set edpm vars as facts
when: "'content' in _edpm_content"
ansible.builtin.set_fact:
"{{ item.key }}": "{{ item.value }}"
cacheable: true
loop: "{{ _edpm_content['content'] | b64decode | from_yaml | dict2items }}"
loop_control:
loop_var: item

- name: Load all parameters from parameters directory
vars:
provided_dir: "{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters"
ansible.builtin.include_role:
name: cifmw_helpers
tasks_from: var_dir.yml
apply:
delegate_to: localhost
become: false
gather_facts: false

- name: Set cifmw_prepare_openstackversion fact
ansible.builtin.set_fact:
cifmw_prepare_openstackversion: false

- name: Perform Podified and EDPM deployment on compute nodes with virtual baremetal (pre-update)
ansible.builtin.command:
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework"
cmd: >-
ansible-playbook deploy-edpm.yml
-i "{{ ansible_user_dir }}/ci-framework-data/artifacts/zuul_inventory.yml"
-e @group_vars/all.yml
-e @scenarios/centos-9/base.yml
-e @scenarios/centos-9/edpm_baremetal_deployment_ci.yml
{%- if edpm_file.stat.exists %}
-e @{{ ansible_user_dir }}/ci-framework-data/artifacts/edpm-ansible.yml
{%- endif %}
{%- if cifmw_extras is defined %}
{%- for extra_var in cifmw_extras %}
-e "{{ extra_var }}"
{%- endfor %}
{%- endif %}
-e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml"
-e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/operator_build_output_pre_update.yml"
-e "cifmw_prepare_openstackversion=false"
- name: Phase 1 - Deploy with pre-update index image using deploy-edpm.yml
ansible.builtin.import_playbook: ../../../deploy-edpm.yml
26 changes: 13 additions & 13 deletions ci/playbooks/edpm_baremetal_update/update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# CI playbook orchestrator for OpenStack minor version updates.
# This playbook runs on the controller (cifmw_zuul_target_host) and orchestrates
# the update by calling update-edpm.yml on the target host (cifmw_target_host).
# This playbook runs on the zuul host (cifmw_zuul_target_host) and orchestrates
# the update by calling the update role's update_variant_ci.yml task (no nested ansible-playbook).
# This playbook depends on content provider variables from CI jobs.
# This is Phase 2 of the baremetal update workflow and should be called
# sequentially after run.yml (Phase 1).
Expand Down Expand Up @@ -39,14 +39,14 @@
mode: "0644"
when: cifmw_minor_update_index_image is defined

- name: Run update-edpm.yml on target host
ansible.builtin.command:
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework"
cmd: >-
ansible-playbook ci/playbooks/edpm_baremetal_update/update-edpm.yml
-i "{{ ansible_user_dir }}/ci-framework-data/artifacts/zuul_inventory.yml"
-e @group_vars/all.yml
-e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml"
{%- if cifmw_minor_update_index_image is defined %}
-e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/minor_update_index_image.yml"
{%- endif %}
- name: Load all parameters from parameters directory
vars:
provided_dir: "{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters"
ansible.builtin.include_role:
name: cifmw_helpers
tasks_from: var_dir.yml

- name: Run minor update using update role
ansible.builtin.include_role:
name: update
tasks_from: update_variant_ci.yml
27 changes: 25 additions & 2 deletions reproducer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,46 @@
name: firewalld
state: restarted

- name: Run deployment if instructed to
- name: Run deployment if instructed to (controller-0 legacy mode)
when:
- cifmw_deploy_architecture | default(false) | bool
- not (cifmw_run_on_zuul_host | default(false) | bool)
no_log: "{{ cifmw_nolog | default(true) | bool }}"
async: "{{ 7200 + cifmw_test_operator_timeout | default(3600) }}" # 2h should be enough to deploy EDPM and rest for tests.
poll: 20
delegate_to: controller-0
ansible.builtin.command:
cmd: "$HOME/deploy-architecture.sh {{ cifmw_deploy_architecture_args | default('') }}"

- name: Run post deployment if instructed to
- name: Run deployment if instructed to (zuul host direct execution)
when:
- cifmw_deploy_architecture | default(false) | bool
- cifmw_run_on_zuul_host | default(false) | bool
no_log: "{{ cifmw_nolog | default(true) | bool }}"
async: "{{ 7200 + cifmw_test_operator_timeout | default(3600) }}" # 2h should be enough to deploy EDPM and rest for tests.
poll: 20
ansible.builtin.command:
cmd: "$HOME/deploy-architecture.sh {{ cifmw_deploy_architecture_args | default('') }}"

- name: Run post deployment if instructed to (controller-0 legacy mode)
when:
- cifmw_deploy_architecture | default(false) | bool
- cifmw_post_deployment | default(true) | bool
- not (cifmw_run_on_zuul_host | default(false) | bool)
no_log: "{{ cifmw_nolog | default(true) | bool }}"
async: "{{ 7200 + cifmw_test_operator_timeout | default(3600) }}" # 2h should be enough to deploy EDPM and rest for tests.
poll: 20
delegate_to: controller-0
ansible.builtin.command:
cmd: "$HOME/post_deployment.sh {{ cifmw_post_deploy_args | default('') }}"

- name: Run post deployment if instructed to (zuul host direct execution)
when:
- cifmw_deploy_architecture | default(false) | bool
- cifmw_post_deployment | default(true) | bool
- cifmw_run_on_zuul_host | default(false) | bool
no_log: "{{ cifmw_nolog | default(true) | bool }}"
async: "{{ 7200 + cifmw_test_operator_timeout | default(3600) }}" # 2h should be enough to deploy EDPM and rest for tests.
poll: 20
ansible.builtin.command:
cmd: "$HOME/post_deployment.sh {{ cifmw_post_deploy_args | default('') }}"
5 changes: 5 additions & 0 deletions roles/reproducer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ cifmw_reproducer_validate_network_host: "controller-0.utility"
cifmw_reproducer_validate_ocp_layout: true

cifmw_reproducer_ironic_node_name_prefix:

# Enable zuul host direct execution (Phase 1-3: parallel with controller-0, Phase 4: required)
# When true, playbooks run directly on zuul host instead of delegating to controller-0 VM
# This eliminates nested ansible-playbook execution
cifmw_run_on_zuul_host: false
Loading