Skip to content

Commit 466f2c6

Browse files
committed
Update gcp 8 and 9 packer definitions
1 parent d528449 commit 466f2c6

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

almalinux-8-gcp.pkr.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ build {
100100
only = ["qemu.almalinux-8-gcp-aarch64"]
101101
}
102102

103-
# copy the repo metadata file into output
103+
# copy SBOM metadata file into output
104104
post-processor "shell-local" {
105105
inline = [
106-
"cp /tmp/repo-metadata-$PACKER_BUILD_NAME.txt output-$PACKER_BUILD_NAME/"
106+
"cp /tmp/sbom-data-$PACKER_BUILD_NAME.json output-$PACKER_BUILD_NAME/"
107107
]
108108
}
109109

almalinux-9-gcp.pkr.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ build {
100100
only = ["qemu.almalinux-9-gcp-aarch64"]
101101
}
102102

103-
# copy the repo metadata file into output
103+
# copy SBOM metadata file into output
104104
post-processor "shell-local" {
105105
inline = [
106-
"cp /tmp/repo-metadata-$PACKER_BUILD_NAME.txt output-$PACKER_BUILD_NAME/"
106+
"cp /tmp/sbom-data-$PACKER_BUILD_NAME.json output-$PACKER_BUILD_NAME/"
107107
]
108108
}
109109

ansible/roles/cleanup_vm/tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
- name: Include sbom_data role for SBOM data collection
3-
include_role:
4-
name: sbom_data
5-
when: collect_sbom_data | bool
6-
72
- name: Remove older versions kernel and other packages
83
ansible.builtin.command: dnf -y remove --oldinstallonly
94
register: removeoldoutput
105
changed_when: removeoldoutput.rc == 0
116
ignore_errors: yes
127

8+
- name: Include sbom_data role for SBOM data collection
9+
include_role:
10+
name: sbom_data
11+
when: collect_sbom_data | bool
12+
1313
- name: Include repo metadata dump role (for SBOMs)
1414
include_role:
1515
name: dump_repo_metadata

ansible/roles/sbom_data/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
- name: Collect SBOM data from the system
88
ansible.builtin.shell: python3 /dev/shm/sbom_data_collector.py -o /dev/shm/sbom-data.json -v
99
register: sbom_data_collector
10+
failed_when: false
1011

1112
- name: Write SBOM data to artifact file
1213
ansible.builtin.fetch:
1314
src: /dev/shm/sbom-data.json
14-
dest: "/tmp/sbom-data-{{ packer_build_name }}.json"
15+
dest: /tmp/sbom-data-{{ packer_build_name }}.json
1516
flat: true
1617
become: false
18+
when: sbom_data_collector.changed

0 commit comments

Comments
 (0)