CI for the TripleO project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bootstrap-overcloud-full.sh 3.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. set -eux
  3. export STABLE_RELEASE=${STABLE_RELEASE:-""}
  4. # Source deploy.env if it exists. It should exist if we are running under
  5. # tripleo-ci
  6. export TRIPLEO_ROOT=${TRIPLEO_ROOT:-"/opt/stack/new"}
  7. if [ -f "$TRIPLEO_ROOT/tripleo-ci/deploy.env" ]; then
  8. source $TRIPLEO_ROOT/tripleo-ci/deploy.env
  9. fi
  10. # Ensure epel-release is not installed
  11. sudo yum erase -y epel-release || :
  12. # Copied from toci_gate_test.sh...need to apply this fix on subnodes as well
  13. # TODO(pabelanger): Why is python-requests installed from pip?
  14. # Reinstall python-requests if it was already installed, otherwise it will be
  15. # installed later when other packages are installed.
  16. # TODO(amoralej): remove after https://review.opendev.org/#/c/468872/ is merged
  17. sudo pip uninstall certifi -y || true
  18. sudo pip uninstall urllib3 -y || true
  19. sudo pip uninstall requests -y || true
  20. sudo rpm -e --nodeps python2-certifi || :
  21. sudo rpm -e --nodeps python2-urllib3 || :
  22. sudo rpm -e --nodeps python2-requests || :
  23. sudo yum -y install python-requests python-urllib3
  24. # Remove the anything on the infra image template that might interfere with CI
  25. # Note for tripleo-quickstart: this task is already managed in tripleo-ci-setup-playbook.yml
  26. sudo yum remove -y facter puppet hiera puppetlabs-release rdo-release centos-release-[a-z]*
  27. sudo rm -rf /etc/puppet /etc/hiera.yaml
  28. # Update everything
  29. sudo yum -y update
  30. # instack-undercloud will pull in all the needed deps
  31. # git needed since puppet modules installed from source
  32. # openstack-tripleo-common needed for the tripleo-build-images command
  33. sudo yum -y install instack-undercloud git openstack-tripleo-common
  34. # detect the real path depending on diskimage-builder version
  35. COMMON_ELEMENTS_PATH=$(python -c '
  36. try:
  37. import diskimage_builder.paths
  38. diskimage_builder.paths.show_path("elements")
  39. except:
  40. print("/usr/share/diskimage-builder/elements")
  41. ')
  42. export ELEMENTS_PATH="${COMMON_ELEMENTS_PATH}:/usr/share/instack-undercloud:/usr/share/tripleo-image-elements:/usr/share/tripleo-puppet-elements"
  43. ELEMENTS=$(\
  44. tripleo-build-images \
  45. --image-json-output \
  46. --image-name overcloud-full \
  47. --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images-centos7.yaml \
  48. --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images.yaml \
  49. | jq '. | .[0].elements | map(.+" ") | add' \
  50. | sed 's/"//g')
  51. # delorean-repo is excluded b/c we've already run --repo-setup on this node and
  52. # we don't want to overwrite that.
  53. sudo -E instack \
  54. -e centos7 \
  55. enable-packages-install \
  56. install-types \
  57. $ELEMENTS \
  58. -k extra-data \
  59. pre-install \
  60. install \
  61. post-install \
  62. -b 05-fstab-rootfs-label \
  63. 00-fix-requiretty \
  64. 90-rebuild-ramdisk \
  65. 00-usr-local-bin-secure-path \
  66. -x delorean-repo \
  67. -d
  68. # In the imported elements we have remove-machine-id. In multinode
  69. # jobs that could mean we end up without /etc/machine-id. Make sure
  70. # we have one.
  71. [ -s /etc/machine-id ] || sudo -E systemd-machine-id-setup
  72. PACKAGES=$(\
  73. tripleo-build-images \
  74. --image-json-output \
  75. --image-name overcloud-full \
  76. --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images-centos7.yaml \
  77. --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images.yaml \
  78. | jq '. | .[0].packages | .[] | tostring' \
  79. | sed 's/"//g')
  80. # Install additional packages expected by the image
  81. sudo yum -y install $PACKAGES
  82. sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
  83. sudo setenforce 0