diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst index cfa1be0d5..e07f80861 100644 --- a/doc/source/install/index.rst +++ b/doc/source/install/index.rst @@ -37,20 +37,8 @@ Installation Pre-install steps ================= -Installing bifrost on RHEL or CentOS requires a few extra pre-install steps, -in order to have access to the additional packages contained in the EPEL -repository. Some of the software bifrost leverages, can only be obtained from -EPEL on RHEL and CentOS systems. - -.. note:: Use of EPEL repositories may result in incompatible packages - being installed by the package manager. Care should be taken - when using a system with EPEL enabled. - -RHEL ----- - Enable additional repositories (RHEL only) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +------------------------------------------ The ``extras`` and ``optional`` dnf repositories must be enabled to satisfy bifrost's dependencies. To check:: @@ -76,13 +64,19 @@ to enable them:: sudo dnf config-manager --enable rhui-REGION-rhel-server-optional sudo dnf config-manager --enable rhui-REGION-rhel-server-extras -Enable the EPEL repository -^^^^^^^^^^^^^^^^^^^^^^^^^^ +Enable the EPEL repository (RHEL and CentOS) +-------------------------------------------- -The Extra Packages for Enterprise Linux (EPEL) are required to install some -dependencies. Please refer to the -`official wiki page `_ to install and -configure them. +Building Debian or Ubuntu based images on RHEL or CentOS requires a few extra +pre-install steps, in order to have access to the additional packages contained +in the EPEL repository. + +Please refer to the `official wiki page `_ +to install and configure them. + +.. note:: Use of EPEL repositories may result in incompatible packages + being installed by the package manager. Care should be taken + when using a system with EPEL enabled. Performing the installation =========================== diff --git a/playbooks/roles/bifrost-create-dib-image/tasks/main.yml b/playbooks/roles/bifrost-create-dib-image/tasks/main.yml index 726753ba1..c57c0f149 100644 --- a/playbooks/roles/bifrost-create-dib-image/tasks/main.yml +++ b/playbooks/roles/bifrost-create-dib-image/tasks/main.yml @@ -15,11 +15,6 @@ --- - import_role: name: venv_python_path -- name: Ensure required packages are installed - package: - name: "{{ dib_host_required_packages }}" - state: present - environment: "{{ venv }}" # If attempting to utilize a base Ubuntu image, diskimage-builder # is the recommended, and default path. - name: "Test if image is present" @@ -150,6 +145,15 @@ - name: "Build argument list" set_fact: dib_arglist: "{{dib_trace_arg|default('')}} {{dib_uncompressed_arg|default('')}} {{dib_clearenv_arg|default('')}} {{dib_notmpfs_arg|default('')}} {{dib_offline_arg|default('')}} {{dib_skipbase_arg|default('')}} {{dib_arch_arg|default('')}} {{dib_imagename_arg|default('')}} {{dib_imagetype_arg|default('')}} {{dib_imagesize_arg|default('')}} {{dib_imagecache_arg|default('')}} {{dib_maxresize_arg|default('')}} {{dib_mintmpfs_arg|default('')}} {{dib_mkfsopts_arg|default('')}} {{dib_qemuopts_arg|default('')}} {{dib_rootlabel_arg|default('')}} {{dib_rdelement_arg|default('')}} {{dib_installtype_arg|default('')}} {{dib_packages_arg|default('')}} {{dib_os_element}} {{dib_elements|default('')}}" +- name: Install debootstrap if building a Debian image + package: + name: debootstrap + state: present + when: > + test_image_present.stat.exists == false + and test_image_dib_present.stat.exists == false + and test_image_initramfs_present.stat.exists == false + and ("debian" in dib_os_element or "ubuntu" in dib_os_element) - name: "Initiate image build" command: disk-image-create {{dib_arglist}} environment: "{{ dib_env_vars_final | combine(bifrost_venv_env if enable_venv|bool else {}) | combine({'DIB_BLOCK_DEVICE_CONFIG': dib_partitioning} if dib_partitioning is defined and dib_partitioning|length > 0 else {}) }}" diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml index 1e117d4db..453e83e2e 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Debian_family.yml @@ -29,7 +29,6 @@ required_packages: - genisoimage - kpartx - qemu-utils - - debootstrap - uuid-runtime - curl - socat diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml index 6ec595178..81fb28052 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Fedora.yml @@ -9,7 +9,6 @@ nginx_user: nginx mysql_service_name: mariadb tftp_service_name: tftp required_packages: - - debootstrap - dnsmasq - gcc - genisoimage diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml index 4be5818fb..2f7bc9144 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_RedHat_family.yml @@ -33,7 +33,6 @@ required_packages: - qemu-img - python3-libselinux - python3-policycoreutils - - debootstrap - gcc - python3-pip - socat diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml index 9dac2e220..cf7903b83 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Suse_family.yml @@ -35,7 +35,6 @@ required_packages: - kpartx - qemu-tools - policycoreutils-python - - debootstrap - dpkg - iptables - tar diff --git a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml index e5b1dabd3..a7727718b 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/required_defaults_Ubuntu.yml @@ -26,7 +26,6 @@ required_packages: - genisoimage - kpartx - qemu-utils - - debootstrap - uuid-runtime - curl - dnsmasq diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index ffcd874cc..17ab64c44 100644 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -70,15 +70,6 @@ case ${ID,,} in *) echo "ERROR: Supported package manager not found. Supported: apt, dnf, yum, zypper"; exit 1;; esac -# if running in OpenStack CI, then make sure epel is enabled -# since it may already be present (but disabled) on the host -if env | grep -q ^ZUUL; then - if [ "${OS_FAMILY}" == "RedHat" ]; then - ${INSTALLER_CMD} dnf-utils - sudo dnf config-manager --set-enabled epel || true - fi -fi - for pkg in ${CHECK_CMD_PKGS[@]}; do if ! $(${CHECK_CMD} ${PKG_MAP[$pkg]} &>/dev/null); then ${INSTALLER_CMD} ${PKG_MAP[$pkg]} diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index 6eaf238f5..55ee5096b 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -44,6 +44,10 @@ CLOUD_CONFIG="" WAIT_FOR_DEPLOY=true ENABLE_VENV=true +# Get OS information +source /etc/os-release || source /usr/lib/os-release +OS_DISTRO="$ID" + # Setup openstack_ci test database if run in OpenStack CI. if [ "$ZUUL_BRANCH" != "" ]; then sudo mkdir -p /opt/libvirt/images @@ -83,6 +87,17 @@ elif [ ${BUILD_IMAGE} = "true" ]; then INSPECT_NODES=false DOWNLOAD_IPA=false CREATE_IPA_IMAGE=true + + # if running in OpenStack CI, then make sure epel is enabled + # since it may already be present (but disabled) on the host + # we need epel for debootstrap + if env | grep -q ^ZUUL; then + if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + sudo dnf install -y dnf-utils + sudo dnf install -y epel-release || true + sudo dnf config-manager --set-enabled epel || true + fi + fi elif [ ${ENABLE_KEYSTONE} = "true" ]; then NOAUTH_MODE=false CLOUD_CONFIG="-e cloud_name=bifrost"