From 0acb610d94bd3d8bb48c3cd79b191bf38017a859 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Sun, 27 Jun 2021 17:20:32 +0100 Subject: [PATCH] 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 --- playbooks/roles/bifrost-ironic-install/README.md | 4 ++++ playbooks/roles/bifrost-ironic-install/defaults/main.yml | 1 + .../bifrost-ironic-install/tasks/download_ipa_image.yml | 4 ++++ releasenotes/notes/ipa-headers-032412a0fc741de3.yaml | 5 +++++ 4 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/ipa-headers-032412a0fc741de3.yaml diff --git a/playbooks/roles/bifrost-ironic-install/README.md b/playbooks/roles/bifrost-ironic-install/README.md index 8b162ecd9..c7c94ead1 100644 --- a/playbooks/roles/bifrost-ironic-install/README.md +++ b/playbooks/roles/bifrost-ironic-install/README.md @@ -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. diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 0650c5974..55293d7fc 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -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" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml b/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml index 71ac420d7..e033292ed 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/download_ipa_image.yml @@ -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 diff --git a/releasenotes/notes/ipa-headers-032412a0fc741de3.yaml b/releasenotes/notes/ipa-headers-032412a0fc741de3.yaml new file mode 100644 index 000000000..6ea5172c2 --- /dev/null +++ b/releasenotes/notes/ipa-headers-032412a0fc741de3.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds ``ipa_download_headers`` variable to control HTTP headers used when + downloading IPA images.