Add modify_image_run_command var to modify-image role

In order to run specific command on the image, we need
to add support for --run-command to the modify image role.
It will be useful to run specific command instead of using
script.

This functionality will be consumed here:
https://review.opendev.org/c/openstack/tripleo-quickstart/+/868864

Related-Bug: #2000226

Signed-off-by: Chandan Kumar <chkumar@redhat.com>
Change-Id: I8575c712467db8fea403459d26731dd7070df131
This commit is contained in:
Chandan Kumar 2022-12-29 12:29:34 +05:30
parent f7e9114803
commit 85fcfd4eb2
2 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,12 @@
# image_to_modify:
# modify_script:
# Run a specific command
# modify_image_run_command:
# Note: modify_image_run_command will run first then
# modify_image_upload_files will run. It is useful in case
# to make sure remote directories exists.
# The upload list of files
modify_image_upload_files: []

View File

@ -23,6 +23,10 @@
set_fact: _vc_args="{{ _vc_args }} -x"
when: modify_image_vc_trace|bool
- name: virt-customize agrs --> run command
set_fact: _vc_args="{{ _vc_args }} --run-command {{ modify_image_run_command }}"
when: modify_image_run_command is defined
- name: virt-customize args --> upload files
set_fact: _vc_args="{{ _vc_args }} --upload {{ item.src }}:{{ item.dest }}"
with_items: "{{ modify_image_upload_files }}"