summaryrefslogtreecommitdiffstats
path: root/lib/undercloud-functions.sh
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2017-05-05 16:51:02 -0400
committerDan Radez <dradez@redhat.com>2017-06-22 16:37:59 -0400
commit586110a27dc11e89a5ff3552f3215e8a0716aa92 (patch)
treee1fa6054d3f8077f114675d8de2b5da4a302a374 /lib/undercloud-functions.sh
parentff9beeb45e7d25aedf2d25644497b0468a96ee16 (diff)
Adding conditionals dependent on arch
There are x86 specific build items that can't be used when building on aarch64. Adding conditionals so that the items only get built in when building on x86_64. There are aarch64 specific settings that need to be set for deployment. JIRA: APEX-381 Change-Id: I63e1c99d5d22bbb523c88be7e973a6c834a38b01 Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'lib/undercloud-functions.sh')
-rwxr-xr-xlib/undercloud-functions.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh
index 3bd0341a..44bd3903 100755
--- a/lib/undercloud-functions.sh
+++ b/lib/undercloud-functions.sh
@@ -173,6 +173,7 @@ EOI
echo "Running undercloud installation and configuration."
echo "Logging undercloud installation to stack@undercloud:/home/stack/apex-undercloud-install.log"
ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI
+set -e
openstack-config --set undercloud.conf DEFAULT local_ip ${admin_installer_vm_ip}/${admin_cidr##*/}
openstack-config --set undercloud.conf DEFAULT network_gateway ${admin_installer_vm_ip}
openstack-config --set undercloud.conf DEFAULT network_cidr ${admin_cidr}
@@ -194,6 +195,22 @@ sudo sed -i '/CephClusterFSID:/c\\ CephClusterFSID: \\x27$(cat /proc/sys/kernel
sudo sed -i '/CephMonKey:/c\\ CephMonKey: \\x27'"\$(ceph-authtool --gen-print-key)"'\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
sudo sed -i '/CephAdminKey:/c\\ CephAdminKey: \\x27'"\$(ceph-authtool --gen-print-key)"'\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml
+if [ "\$(uname -i)" == 'aarch64' ]; then
+
+# These two fixes are done in the base OOO image build right now
+# keeping them here to know that they are done and in case we need
+# to take care of them in the future.
+# # remove syslinux references for aarch64
+# sudo sh -xc 'cd /etc/puppet/modules/ironic/manifests && patch -p0 < puppet-ironic-manifests-pxe-pp-aarch64.patch'
+# sudo sed -i '/syslinux-extlinux/d' /usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.pp
+#
+# # disable use_linkat in swift
+# sudo sed -i 's/o_tmpfile_supported()/False/' /usr/lib/python2.7/site-packages/swift/obj/diskfile.py
+
+ openstack-config --set undercloud.conf DEFAULT ipxe_enabled false
+ sudo sed -i '/ _link_ip_address_pxe_configs/a\\ _link_mac_pxe_configs(task)' /usr/lib/python2.7/site-packages/ironic/common/pxe_utils.py
+fi
+
openstack undercloud install &> apex-undercloud-install.log || {
# cat the undercloud install log incase it fails
echo "ERROR: openstack undercloud install has failed. Dumping Log:"
@@ -201,6 +218,30 @@ openstack undercloud install &> apex-undercloud-install.log || {
exit 1
}
+if [ "\$(uname -i)" == 'aarch64' ]; then
+sudo yum -y reinstall grub2-efi shim
+sudo cp /boot/efi/EFI/centos/grubaa64.efi /tftpboot/grubaa64.efi
+sudo mkdir -p /tftpboot/EFI/centos
+sudo tee /tftpboot/EFI/centos/grub.cfg > /dev/null << EOF
+set default=master
+set timeout=5
+set hidden_timeout_quiet=false
+
+menuentry "master" {
+configfile /tftpboot/\\\$net_default_ip.conf
+}
+EOF
+sudo chmod 644 /tftpboot/EFI/centos/grub.cfg
+sudo openstack-config --set /etc/ironic/ironic.conf pxe uefi_pxe_config_template \\\$pybasedir/drivers/modules/pxe_grub_config.template
+sudo openstack-config --set /etc/ironic/ironic.conf pxe uefi_pxe_bootfile_name grubaa64.efi
+sudo service openstack-ironic-conductor restart
+sudo sed -i 's/linuxefi/linux/g' /usr/lib/python2.7/site-packages/ironic/drivers/modules/pxe_grub_config.template
+sudo sed -i 's/initrdefi/initrd/g' /usr/lib/python2.7/site-packages/ironic/drivers/modules/pxe_grub_config.template
+echo '' | sudo tee --append /tftpboot/map-file > /dev/null
+echo 'r ^/EFI/centos/grub.cfg-(.*) /tftpboot/pxelinux.cfg/\\1' | sudo tee --append /tftpboot/map-file > /dev/null
+sudo service xinetd restart
+fi
+
# Set nova domain name
sudo openstack-config --set /etc/nova/nova.conf DEFAULT dns_domain ${domain_name}
sudo openstack-config --set /etc/nova/nova.conf DEFAULT dhcp_domain ${domain_name}