Skip to content

Commit a64ac7a

Browse files
committed
add description of image description to build
1 parent 17a2432 commit a64ac7a

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

ansible/cleanup.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,27 @@
3838

3939
- name: Cleanup /tmp
4040
command : rm -rf /tmp/*
41+
42+
- name: Get package facts
43+
package_facts:
44+
45+
- name: Ensure image summary directory exists
46+
file:
47+
path: /var/lib/image/
48+
owner: root
49+
group: root
50+
mode: u=rwX,go=rX
51+
52+
- name: Write image summary
53+
copy:
54+
content: "{{ image_info | to_nice_json }}"
55+
dest: /var/lib/image/image.json
56+
vars:
57+
image_info:
58+
branch: "{{ lookup('pipe', 'git rev-parse --abbrev-ref HEAD') }}"
59+
build: "{{ ansible_nodename | split('.') | first }}" # hostname is image name, which contains build info
60+
os: "{{ ansible_distribution }} {{ ansible_distribution_version }}"
61+
kernel: "{{ ansible_kernel }}"
62+
ofed: "{{ ansible_facts.packages['mlnx-ofa_kernel'].0.version | default('-') }}"
63+
cuda: "{{ ansible_facts.packages['cuda'].0.version | default('-') }}"
64+
slurm-ohpc: "{{ ansible_facts.packages['slurm-ohpc'].0.version | default('-') }}"

ansible/fatimage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@
177177

178178
- hosts: builder
179179
become: yes
180-
gather_facts: no
180+
gather_facts: yes
181+
tags: finalise
181182
tasks:
182-
# - meta: end_here
183183
- name: Cleanup image
184184
import_tasks: cleanup.yml
185185

0 commit comments

Comments
 (0)