From 0e64d83752e6210c16656a9e019def83fe52a24b Mon Sep 17 00:00:00 2001 From: tw0410 Date: Tue, 16 Apr 2019 13:27:36 +0900 Subject: [PATCH] Add ipxe file path variable and installation codes for CentOS In _ironic-conductor-pxe-init.sh.tpl file, there are only codes for ubuntu system. However in Openstack-Helm especially in kolla image, there are Ubuntu version and CentOS version. So add codes for OS dependency check and ipxe file PATH for each OS. Change-Id: I04886da64ae0dfda782bcd8d8d2cde960ab1db1d Signed-off-by: TaewooLee --- .../bin/_ironic-conductor-pxe-init.sh.tpl | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl b/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl index b8c4c4cd62..2f41d16447 100644 --- a/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl +++ b/ironic/templates/bin/_ironic-conductor-pxe-init.sh.tpl @@ -18,10 +18,28 @@ limitations under the License. set -ex -#NOTE(portdirect): this works round a limitation in Kolla images -if ! dpkg -l ipxe; then - apt-get update - apt-get install ipxe -y +. /etc/os-release +HOST_OS=${HOST_OS:="${ID}"} +FILEPATH=${FILEPATH:-/usr/lib/ipxe} + +if [ "x$ID" == "xubuntu" ]; then + #NOTE(portdirect): this works around a limitation in Kolla images + if ! dpkg -l ipxe; then + apt-get update + apt-get install ipxe -y + fi + + FILEPATH=/usr/lib/ipxe + +elif [ "x$ID" == "xcentos" ]; then + + if ! yum list installed ipxe-bootimgs >/dev/null 2>&1; then + yum update --nogpgcheck -y + yum install ipxe-bootimgs --nogpgcheck -y + fi + + FILEPATH=/usr/share/ipxe + fi mkdir -p /var/lib/openstack-helm/tftpboot