Allow HTTP headers to be customised for IPA image download

This is useful if you need to specify a token when downloading
the image.

Change-Id: I27835fbb70f01cc2ef98184e1e658f3bbce7ae54
This commit is contained in:
Will Szumski 2021-06-27 17:20:32 +01:00
parent c4ee8e5d77
commit 0acb610d94
4 changed files with 14 additions and 0 deletions

View File

@ -269,6 +269,10 @@ ssh_private_key: If a user wishes to define an SSH private key as a string,
this variable can be utilized which overrides the
ssh_private_key_path setting.
### Ironic Python Agent
ipa_download_headers: HTTP headers to use when downloading IPA.
### Changing Database Configuration
Bifrost utilizes a nested data stucture for the configuration of database.

View File

@ -73,6 +73,7 @@ use_tinyipa: true
enable_uefi_ipxe: true
ipxe_efi_binary: ipxe.efi
ipa_download_headers: {}
ipa_kernel: "{{http_boot_folder}}/ipa.kernel"
ipa_ramdisk: "{{http_boot_folder}}/ipa.initramfs"
ipa_kernel_url: "{{ ipa_file_protocol }}://{{ internal_ip }}:{{ file_url_port }}/ipa.kernel"

View File

@ -23,6 +23,7 @@
get_url:
url: "{{ ipa_kernel_upstream_checksum_url }}"
dest: "{{ ipa_kernel }}.{{ ipa_kernel_upstream_checksum_algo }}"
headers: "{{ ipa_download_headers | default(omit, true) }}"
timeout: 300
force: yes
owner: ironic
@ -47,6 +48,7 @@
mode: 0644
checksum: "{{ ipa_kernel_checksum | default(omit) }}"
timeout: 300
headers: "{{ ipa_download_headers | default(omit, true) }}"
# Keep downloading it until we get a good copy
force: yes
register: ipa_kernel_download_done
@ -66,6 +68,7 @@
get_url:
url: "{{ ipa_ramdisk_upstream_checksum_url }}"
dest: "{{ ipa_ramdisk }}.{{ ipa_ramdisk_upstream_checksum_algo }}"
headers: "{{ ipa_download_headers | default(omit, true) }}"
timeout: 300
force: yes
owner: ironic
@ -87,6 +90,7 @@
dest: "{{ ipa_ramdisk }}"
owner: ironic
group: ironic
headers: "{{ ipa_download_headers | default(omit, true) }}"
mode: 0644
checksum: "{{ ipa_ramdisk_checksum | default(omit) }}"
timeout: 300

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds ``ipa_download_headers`` variable to control HTTP headers used when
downloading IPA images.