diff --git a/diskimage-create/README.rst b/diskimage-create/README.rst index 88d00a22cc..e94a15baa7 100644 --- a/diskimage-create/README.rst +++ b/diskimage-create/README.rst @@ -94,7 +94,7 @@ Command syntax: [-a i386 | **amd64** | armhf | ppc64le ] [-b **haproxy** ] [-c **~/.cache/image-create** | ] - [-d **xenial**/**7** | trusty | ] + [-d **xenial**/**7** | trusty | 8 | ] [-e] [-f] [-h] @@ -201,22 +201,24 @@ For example to build a CentOS 7 amphora with Pike RPM packages: RHEL specific variables ------------------------ Building a RHEL-based image requires: - - a RHEL 7 base cloud image, manually download from the - Red Hat Customer Portal. Set the DIB_LOCAL_IMAGE variable - to point to the file. More details at: - /elements/rhel7 + - a Red Hat Enterprise Linux KVM Guest Image, manually download from the + Red Hat Customer Portal. Set the DIB_LOCAL_IMAGE variable to point to + the file. More details at: + /elements/rhel - a Red Hat subscription for the matching Red Hat OpenStack Platform - repository. Set the needed registration parameters depending on your - configuration. More details at: + repository if you want to install the amphora agent from the official + distribution package (requires setting -p option in diskimage-create.sh). + Set the needed registration parameters depending on your configuration. + More details at: /elements/rhel-common -Here is an example with Customer Portal registration and OSP 8 repository: +Here is an example with Customer Portal registration and OSP 13 repository: .. code:: bash - $ export DIB_LOCAL_IMAGE='/tmp/rhel-guest-image-7.2-20160302.0.x86_64.qcow2' + $ export DIB_LOCAL_IMAGE='/tmp/rhel-server-7.6-x86_64-kvm.qcow2' - $ export REG_METHOD='portal' REG_REPOS='rhel-7-server-openstack-8-rpms' + $ export REG_METHOD='portal' REG_REPOS='rhel-7-server-openstack-13-rpms' $ export REG_USER='' REG_PASSWORD='' REG_AUTO_ATTACH=true @@ -224,7 +226,7 @@ This example uses registration via a Satellite (the activation key must enable an OSP repository): .. code:: bash - $ export DIB_LOCAL_IMAGE='/tmp/rhel-guest-image-7.2-20160302.0.x86_64.qcow2' + $ export DIB_LOCAL_IMAGE='/tmp/rhel-server-7.6-x86_64-kvm.qcow2' $ export REG_METHOD='satellite' REG_ACTIVATION_KEY="" @@ -282,4 +284,3 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index eef9da6856..b6771ba5d9 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -23,7 +23,7 @@ usage() { echo " [-a i386 | **amd64** | armhf | ppc64le]" echo " [-b **haproxy** ]" echo " [-c **~/.cache/image-create** | ]" - echo " [-d **xenial**/**7** | trusty | ]" + echo " [-d **xenial**/**7** | trusty | 8 | ]" echo " [-e]" echo " [-f]" echo " [-h]" @@ -224,7 +224,7 @@ AMP_ENABLE_FULL_MAC_SECURITY=${AMP_ENABLE_FULL_MAC_SECURITY:-0} AMP_DISABLE_TMP_FS=${AMP_DISABLE_TMP_FS:-""} if [ "$AMP_BASEOS" = "rhel" -o "$AMP_BASEOS" = "centos" -o "$AMP_BASEOS" = "fedora" ] && [ "$AMP_IMAGESIZE" -lt 3 ]; then - echo "RHEL/centos based amphora requires an image size of at least 3GB" + echo "RHEL/CentOS based amphora requires an image size of at least 3GB" exit 1 fi @@ -262,8 +262,8 @@ export CLOUD_INIT_DATASOURCES=${CLOUD_INIT_DATASOURCES:-"ConfigDrive"} # Additional RHEL environment checks if [ "${AMP_BASEOS}" = "rhel" ]; then if [ -z "${DIB_LOCAL_IMAGE}" ]; then - echo "DIB_LOCAL_IMAGE variable must be set and point to a RHEL 7 base cloud image. Exiting." - echo "For more information, see the README file in ${DIB_ELEMENTS_PATH}/elements/rhel7" + echo "DIB_LOCAL_IMAGE variable must be set and point to a RHEL base cloud image. Exiting." + echo "For more information, see the README file in ${DIB_ELEMENTS_PATH}/elements/rhel" exit 1 fi fi @@ -345,9 +345,12 @@ pushd $TEMP > /dev/null # Setup the elements list AMP_element_sequence=${AMP_element_sequence:-"base vm"} -if [ "${AMP_BASEOS}" = "centos" ] || [ "${AMP_BASEOS}" = "rhel" ]; then +if [ "${AMP_BASEOS}" = "centos" ]; then AMP_element_sequence="$AMP_element_sequence ${AMP_BASEOS}${DIB_RELEASE}" else + if [ "${AMP_BASEOS}" = "rhel" ] && [ "${DIB_RELEASE}" = "8" ]; then + export DIB_INSTALLTYPE_pip_and_virtualenv=package + fi AMP_element_sequence="$AMP_element_sequence ${AMP_BASEOS}" fi diff --git a/elements/amphora-agent/package-installs.yaml b/elements/amphora-agent/package-installs.yaml index 2d8d02c6e0..ec962b8847 100644 --- a/elements/amphora-agent/package-installs.yaml +++ b/elements/amphora-agent/package-installs.yaml @@ -36,6 +36,7 @@ lsof: net-tools: netbase: netcat-openbsd: +network-scripts: open-vm-tools: openssh-client: openssh-server: diff --git a/elements/amphora-agent/pkg-map b/elements/amphora-agent/pkg-map index e743b2eb35..bd7d314df2 100644 --- a/elements/amphora-agent/pkg-map +++ b/elements/amphora-agent/pkg-map @@ -1,4 +1,14 @@ { + "release": { + "rhel": { + "8": { + "python-dev": "platform-python-devel", + "vlan": "", + "screen": "", + "dkms": "" + } + } + }, "family": { "redhat": { "amphora-agent": "openstack-octavia-amphora-agent", @@ -10,17 +20,19 @@ "cloud-guest-utils": "", "apparmor": "", "dmeventd": "", - "isc-dhcp-client": "", + "isc-dhcp-client": "dhcp-client", "uuid-runtime": "", "ubuntu-cloudimage-keyring": "", "vim-tiny": "", "ureadahead": "", "apt-transport-https": "", "pollinate": "", - "ifupdown": "" + "ifupdown": "", + "network-scripts": "network-scripts" } }, "default": { - "amphora-agent": "amphora-agent" + "amphora-agent": "amphora-agent", + "network-scripts": "" } } diff --git a/elements/amphora-agent/post-install.d/10-enable-network-scripts b/elements/amphora-agent/post-install.d/10-enable-network-scripts new file mode 100755 index 0000000000..e93464311a --- /dev/null +++ b/elements/amphora-agent/post-install.d/10-enable-network-scripts @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi + +set -eu +set -o pipefail + +if [ "$DISTRO_NAME" == "rhel" ] && [ "$DIB_RELEASE" == "8" ]; then + chkconfig network on +fi diff --git a/releasenotes/notes/add-rhel-amphora-ab4a7bada2fa3eb7.yaml b/releasenotes/notes/add-rhel-amphora-ab4a7bada2fa3eb7.yaml new file mode 100644 index 0000000000..13df622659 --- /dev/null +++ b/releasenotes/notes/add-rhel-amphora-ab4a7bada2fa3eb7.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Added support to create RHEL 8 amphora images.