Copy ostree checksum during subcloud prestaging

This commit generates an md5-based checksum across the ostree_repo
directory during prestaging. The checksum is transferred as part of the
prestaging data, so that it can be used to validate the integrity of the
prestage data.

Test Plan
PASS:
- Perform subcloud prestaging operation. Verify that the checksum is
  properly calculated and is placed in the appropriate
  /opt/platform-backup location for subcloud install.

Partial-Bug: 1999306

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: I6d51ba933414350f67025547ed76e80fa0c3daec
This commit is contained in:
Kyle MacLeod
2022-12-10 20:08:23 -05:00
parent 4c87840c24
commit 0e1e95b692
2 changed files with 11 additions and 0 deletions

View File

@@ -41,4 +41,10 @@
register: result
until: result.rc == 0
- name: Generate ostree_repo directory checksum
shell: >-
cd {{ repo_path }}/..
&& find ostree_repo -type f -exec md5sum {} + | LC_ALL=C sort | md5sum | awk '{ print $1; }'
> .ostree_repo_checksum
become: yes

View File

@@ -51,6 +51,11 @@
no_log: true
connection: local
- name: Copy prestaging repo checksum from system controller to {{ inventory_hostname }}
copy:
src: "{{ prestaging_repo }}/../.ostree_repo_checksum"
dest: "{{ prestage_dir }}/../"
- name: Restore the ownership of the prestage dir on the subcloud
file:
path: "{{ platform_backup_dir }}"