Skip to content

Commit 650341d

Browse files
committed
build status update
Signed-off-by: Abhishek S A <abhishek.sa3@dell.com>
1 parent e993e44 commit 650341d

3 files changed

Lines changed: 52 additions & 97 deletions

File tree

src/image_build_manager/roles/fetch_packages/tasks/write_build_status.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/image_build_manager/roles/image_creation/tasks/write_build_status.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,37 +41,21 @@
4141
- "{{ _output_base }}"
4242
- "{{ _output_domain }}"
4343

44-
- name: Collect built images from oim host
45-
ansible.builtin.set_fact:
46-
_collected_images: "{{ hostvars['oim']['build_completed_images'] | default({}) }}"
47-
48-
- name: Build functional_group_images list grouped by arch
49-
ansible.builtin.set_fact:
50-
_fg_images_list: >-
51-
[{% for arch in _collected_images.keys() %}
52-
{"{{ arch }}": {{ _collected_images[arch] | to_json }}}{{ "," if not loop.last else "" }}
53-
{% endfor %}]
54-
55-
- name: Build the status data structure
56-
ansible.builtin.set_fact:
57-
build_status_data:
58-
overall_status: "success"
59-
s3_configurations:
60-
endpoint_url: "{{ s3_endpoint | default('http://' + admin_nic_ip + ':9000') }}"
61-
bucket: "{{ s3_configurations.bucket | default('boot-images') }}"
62-
functional_group_images: "{{ _fg_images_list }}"
63-
6444
- name: Write build_status.yml (latest — always overwritten)
65-
ansible.builtin.copy:
66-
content: "{{ build_status_data | to_nice_yaml(indent=2) }}"
45+
ansible.builtin.template:
46+
src: "{{ role_path }}/templates/build_status.yml.j2"
6747
dest: "{{ _output_base }}/build_status.yml"
6848
mode: "0644"
49+
vars:
50+
build_completed_images: "{{ hostvars['oim']['build_completed_images'] | default({}) }}"
6951

7052
- name: Write versioned build_status copy
71-
ansible.builtin.copy:
72-
content: "{{ build_status_data | to_nice_yaml(indent=2) }}"
53+
ansible.builtin.template:
54+
src: "{{ role_path }}/templates/build_status.yml.j2"
7355
dest: "{{ _output_domain }}/build_status_{{ _omnia_version }}_{{ ansible_date_time.date | regex_replace('-', '') }}_{{ ansible_date_time.hour }}{{ ansible_date_time.minute }}.yml"
7456
mode: "0644"
57+
vars:
58+
build_completed_images: "{{ hostvars['oim']['build_completed_images'] | default({}) }}"
7559

7660
- name: Display build status output locations
7761
ansible.builtin.debug:
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
---
15+
# ============================================================================
16+
# build_status.yml — image_build_manager output
17+
# ============================================================================
18+
# Location (NFS):
19+
# /opt/omnia/output/project_default/build_status.yml (latest)
20+
# /opt/omnia/output/project_default/image_build_manager/
21+
# build_status_<version>_<timestamp>.yml (versioned)
22+
#
23+
# Consumed by:
24+
# - provision domain (BSS template rendering)
25+
# - provision/roles/provision_validations/tasks/validate_image.yml
26+
# - provision/roles/configure_ochami/tasks/configure_bss_group.yml
27+
# ============================================================================
28+
29+
overall_status: "success"
30+
31+
s3_configurations:
32+
endpoint_url: "{{ s3_endpoint | default('http://' + admin_nic_ip + ':9000') }}"
33+
bucket: "{{ s3_configurations.bucket | default('boot-images') }}"
34+
35+
functional_group_images:
36+
{% for arch_item in build_completed_images | dict2items %}
37+
- {{ arch_item.key }}:
38+
{% for image in arch_item.value %}
39+
- functional_group: "{{ image.functional_group }}"
40+
kernel: "{{ image.kernel }}"
41+
initrd: "{{ image.initrd }}"
42+
image: "{{ image.image }}"
43+
{% endfor %}
44+
{% endfor %}

0 commit comments

Comments
 (0)