Allow dib_elements key to be a nested list

It's highly likely that folks may want to use YAML anchors to
build up list of DIB elements.  To aid in that, allow the value
to be a list of lists and automatically flatton it.

Change-Id: I55b9cb16951b51da32f99ca5858b75217951b279
This commit is contained in:
James E. Blair 2024-09-12 07:53:20 -07:00
parent 7dfb7d0eeb
commit 4e1e155638
3 changed files with 8 additions and 2 deletions

View File

@ -23,7 +23,7 @@ Example:
.. zuul:rolevar:: build_diskimage_command
:default: "{{ ensure_dib_command }}"
Path to the build-disk-image command. This defaults to
Path to the build-disk-image command. This defaults to
{{ ensure_dib_command }}. as being set by the ensure-dib role.
.. zuul:rolevar:: build_diskimage_image_name
@ -42,6 +42,9 @@ Example:
List of elements that should be used when creating the disk image.
For ease of use with YAML anchors, this may be provided as a list
of lists which will be flattened automatically.
.. zuul:rolevar:: build_diskimage_environment
:type: dict

View File

@ -9,7 +9,7 @@
-o "{{ build_diskimage_image_root }}/{{ build_diskimage_image_name | mandatory }}"
-t "{{ build_diskimage_formats | join(',') }}"
--logfile "{{ build_diskimage_logs_dir }}/diskimage-{{ build_diskimage_image_name }}.log"
{{ build_diskimage_elements | mandatory | join(' ') }}
{{ build_diskimage_elements | mandatory | flatten | join(' ') }}
args:
chdir: "{{ build_diskimage_image_root }}"
environment: "{{ build_diskimage_environment }}"

View File

@ -26,6 +26,9 @@
List of elements that should be used when creating the disk image.
For ease of use with YAML anchors, this may be provided as a list
of lists which will be flattened automatically.
.. zuul:jobvar:: build_diskimage_environment
:type: dict