From 9f62bc9a333826d24a48dc66dcd8bfd31ccf4f7c Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 4 Aug 2020 12:52:49 +0200 Subject: [PATCH] Support default_boot_mode and prepare the CI for different boot modes Change-Id: I0c56824aa0041f24d4ca172b590c8504cef3d9c4 --- playbooks/ci/run.yaml | 1 + playbooks/roles/bifrost-ironic-install/defaults/main.yml | 2 ++ .../roles/bifrost-ironic-install/templates/ironic.conf.j2 | 3 +++ releasenotes/notes/default-boot-mode-5561325f68224719.yaml | 5 +++++ scripts/test-bifrost.sh | 7 ++++++- 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/default-boot-mode-5561325f68224719.yaml diff --git a/playbooks/ci/run.yaml b/playbooks/ci/run.yaml index e1ec411a7..dafa646f5 100644 --- a/playbooks/ci/run.yaml +++ b/playbooks/ci/run.yaml @@ -13,3 +13,4 @@ USE_DHCP: "{{ use_dhcp | default(false) | bool | lower }}" ENABLE_VENV: "{{ use_venv | default(true) | bool | lower }}" ZUUL_BRANCH: "{{ zuul.branch }}" + BOOT_MODE: "{{ boot_mode | default('') }}" diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 8dcdd1610..ed0b8047a 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -136,6 +136,8 @@ enabled_power_interfaces: "" default_resource_class: baremetal +default_boot_mode: "" + enable_credential_less_deploy: false # Extra pip packages to install with ironic diff --git a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 index 0ddecab8d..48ea0183b 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 @@ -68,6 +68,9 @@ enable_netboot_fallback = true http_url = http://{{ internal_ip }}:{{ file_url_port }}/ http_root = {{ http_boot_folder }} default_boot_option = local +{% if default_boot_mode | default('') != '' %} +default_boot_mode = {{ default_boot_mode }} +{% endif %} fast_track = {{ fast_track }} {% if cleaning_disk_erase | bool %} erase_devices_priority = 10 diff --git a/releasenotes/notes/default-boot-mode-5561325f68224719.yaml b/releasenotes/notes/default-boot-mode-5561325f68224719.yaml new file mode 100644 index 000000000..364d6a900 --- /dev/null +++ b/releasenotes/notes/default-boot-mode-5561325f68224719.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new parameter ``default_boot_mode`` allows specifying the default boot + mode: ``uefi`` or ``bios``. diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index 3621b1eae..39ed9ffb7 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -13,6 +13,7 @@ ENABLE_KEYSTONE="${ENABLE_KEYSTONE:-false}" ZUUL_BRANCH=${ZUUL_BRANCH:-} ENABLE_VENV=true CLI_TEST=${CLI_TEST:-false} +BOOT_MODE=${BOOT_MODE:-} # Set defaults for ansible command-line options to drive the different # tests. @@ -97,7 +98,11 @@ elif [ ${BUILD_IMAGE} = "true" ]; then fi elif [ ${ENABLE_KEYSTONE} = "true" ]; then NOAUTH_MODE=false - CLOUD_CONFIG="-e cloud_name=bifrost" + CLOUD_CONFIG+=" -e cloud_name=bifrost" +fi + +if [[ -n "$BOOT_MODE" ]]; then + CLOUD_CONFIG+=" -e default_boot_mode=$BOOT_MODE" fi logs_on_exit() {