Skip to content

Commit

Permalink
feat: multiarch fedora template.
Browse files Browse the repository at this point in the history
Fedora offers images for a variety of architectures, which can be
included as a template parameter. Within the template, there is a
specific parameter for defining the architecture.

For the sake of simplicity, I have currently set the host architecture.

Signed-off-by: Nestor Acuna Blanco <[email protected]>
  • Loading branch information
nestoracunablanco committed Oct 17, 2024
1 parent f360d84 commit b726d01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions generate-templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@

- name: Load Fedora containerdisk and image urls
set_fact:
fedora_containerdisk_urls: "{{ fedora_containerdisk_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'eq', 'containerdisk') |map(attribute='url') |map('replace', 'docker://', '') |list }}"
fedora_image_urls: "{{ fedora_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', 'x86_64') |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
fedora_containerdisk_urls: "{{ fedora_containerdisk_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', ansible_architecture) |selectattr('format', 'eq', 'containerdisk') |map(attribute='url') |map('replace', 'docker://', '') |list }}"
fedora_image_urls: "{{ fedora_image_urls |default([]) + lookup('osinfo', item) |attr('image_list') |selectattr('architecture', 'eq', ansible_architecture) |selectattr('format', 'in', ['raw', 'qcow2']) |map(attribute='url') |list }}"
loop: "{{ fedora_labels }}"

- name: Generate Fedora templates
Expand Down
2 changes: 1 addition & 1 deletion templates/fedora.tpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ objects:
kubevirt.io/domain: ${NAME}
kubevirt.io/size: {{ item.flavor }}
spec:
architecture: amd64
architecture: "{{ 'amd64' if ansible_architecture == 'x86_64' else ansible_architecture }}"
domain:
features:
smm:
Expand Down

0 comments on commit b726d01

Please sign in to comment.