Support RHEL base image in DIB
This adds a rhel type and gives some pointers on needed environment variables for base image, registration, needed subscriptions. no-resolvconf is also updated to work on rhel-type systems Depends-On: Icb0e20b01479fea345e01309fc4bf3f7f639900c Change-Id: Ic452feaf32fe7699ebd072f21dd630a2ac93bb5f
This commit is contained in:
parent
a3803ad68b
commit
6e97a37744
|
@ -93,7 +93,7 @@ Command syntax:
|
||||||
[-b **haproxy** ]
|
[-b **haproxy** ]
|
||||||
[-c **~/.cache/image-create** | <cache directory> ]
|
[-c **~/.cache/image-create** | <cache directory> ]
|
||||||
[-h]
|
[-h]
|
||||||
[-i **ubuntu** | fedora | centos ]
|
[-i **ubuntu** | fedora | centos | rhel ]
|
||||||
[-o **amphora-x64-haproxy** | <filename> ]
|
[-o **amphora-x64-haproxy** | <filename> ]
|
||||||
[-r <root password> ]
|
[-r <root password> ]
|
||||||
[-s **5** | <size in GB> ]
|
[-s **5** | <size in GB> ]
|
||||||
|
@ -159,9 +159,42 @@ ELEMENTS_REPO_PATH
|
||||||
|
|
||||||
OCTAVIA_REPO_PATH
|
OCTAVIA_REPO_PATH
|
||||||
- Directory containing octavia
|
- Directory containing octavia
|
||||||
- <directory above the script location>
|
- Default: <directory above the script location>
|
||||||
- Reference: https://github.com/openstack/octavia
|
- Reference: https://github.com/openstack/octavia
|
||||||
|
|
||||||
|
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:
|
||||||
|
<DIB_REPO_PATH>/elements/rhel7
|
||||||
|
|
||||||
|
- a Red Hat subscription for the matching Red Hat OpenStack Platform
|
||||||
|
repository. Set the needed registration parameters depending on your
|
||||||
|
configuration. More details at:
|
||||||
|
<DIB_REPO_PATH>/elements/rhel-common
|
||||||
|
|
||||||
|
Here is an example with Customer Portal registration and OSP 8 repository:
|
||||||
|
.. code:: bash
|
||||||
|
|
||||||
|
$ export DIB_LOCAL_IMAGE='/tmp/rhel-guest-image-7.2-20160302.0.x86_64.qcow2'
|
||||||
|
|
||||||
|
$ export REG_METHOD='portal' REG_REPOS='rhel-7-server-openstack-8-rpms'
|
||||||
|
|
||||||
|
$ export REG_USER='<user>' REG_PASSWORD='<password>' REG_AUTO_ATTACH=true
|
||||||
|
|
||||||
|
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 REG_METHOD='satellite' REG_ACTIVATION_KEY="<activation key>"
|
||||||
|
|
||||||
|
$ export REG_SAT_URL="<satellite url>" REG_ORG="<satellite org>"
|
||||||
|
|
||||||
|
|
||||||
Container Support
|
Container Support
|
||||||
=================
|
=================
|
||||||
The Docker command line required to import a tar file created with this script
|
The Docker command line required to import a tar file created with this script
|
||||||
|
|
|
@ -24,7 +24,7 @@ usage() {
|
||||||
echo " [-b **haproxy** ]"
|
echo " [-b **haproxy** ]"
|
||||||
echo " [-c **~/.cache/image-create** | <cache directory> ]"
|
echo " [-c **~/.cache/image-create** | <cache directory> ]"
|
||||||
echo " [-h]"
|
echo " [-h]"
|
||||||
echo " [-i **ubuntu** | fedora | centos ]"
|
echo " [-i **ubuntu** | fedora | centos | rhel ]"
|
||||||
echo " [-o **amphora-x64-haproxy** | <filename> ]"
|
echo " [-o **amphora-x64-haproxy** | <filename> ]"
|
||||||
echo " [-r <root password> ]"
|
echo " [-r <root password> ]"
|
||||||
echo " [-s **5** | <size in GB> ]"
|
echo " [-s **5** | <size in GB> ]"
|
||||||
|
@ -88,7 +88,8 @@ while getopts "a:b:c:hi:o:t:r:s:vw:" opt; do
|
||||||
AMP_BASEOS=$OPTARG
|
AMP_BASEOS=$OPTARG
|
||||||
if [ $AMP_BASEOS != "ubuntu" ] && \
|
if [ $AMP_BASEOS != "ubuntu" ] && \
|
||||||
[ $AMP_BASEOS != "fedora" ] && \
|
[ $AMP_BASEOS != "fedora" ] && \
|
||||||
[ $AMP_BASEOS != "centos" ]; then
|
[ $AMP_BASEOS != "centos" ] && \
|
||||||
|
[ $AMP_BASEOS != "rhel" ]; then
|
||||||
echo "Error: Unsupported base OS " $AMP_BASEOS " specified"
|
echo "Error: Unsupported base OS " $AMP_BASEOS " specified"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
@ -194,6 +195,15 @@ fi
|
||||||
|
|
||||||
export CLOUD_INIT_DATASOURCES=${CLOUD_INIT_DATASOURCES:-"ConfigDrive"}
|
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"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Find out what platform we are on
|
# Find out what platform we are on
|
||||||
if [ -e /etc/os-release ]; then
|
if [ -e /etc/os-release ]; then
|
||||||
platform=$(head -1 /etc/os-release)
|
platform=$(head -1 /etc/os-release)
|
||||||
|
@ -206,7 +216,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$AMP_ROOTPW" ] && [ "$platform" != 'NAME="Ubuntu"' ]; then
|
if [ "$AMP_ROOTPW" ] && [ "$platform" != 'NAME="Ubuntu"' ]; then
|
||||||
if [ "$(getenforce)" != "Disabled" ]; then
|
if [ "$(getenforce)" == "Enforcing" ]; then
|
||||||
echo "A root password cannot be enabled for images built on this platform while SELinux is enabled."
|
echo "A root password cannot be enabled for images built on this platform while SELinux is enabled."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -321,6 +331,9 @@ elif [ "$AMP_BASEOS" = "centos" ]; then
|
||||||
AMP_element_sequence="$AMP_element_sequence centos-mirror"
|
AMP_element_sequence="$AMP_element_sequence centos-mirror"
|
||||||
export CENTOS_MIRROR="$BASE_OS_MIRROR"
|
export CENTOS_MIRROR="$BASE_OS_MIRROR"
|
||||||
fi
|
fi
|
||||||
|
elif [ "$AMP_BASEOS" = "rhel" ]; then
|
||||||
|
AMP_element_sequence=${AMP_element_sequence:-"base vm rhel7"}
|
||||||
|
AMP_element_sequence="$AMP_element_sequence $AMP_BACKEND"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$AMP_ROOTPW" ]; then
|
if [ "$AMP_ROOTPW" ]; then
|
||||||
|
|
|
@ -6,4 +6,4 @@ variable.
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
$ export UBUNTU_MIRROR=http://<local mirror hostname>/<path to mirror>
|
$ export CENTOS_MIRROR=http://<local mirror hostname>/<path to mirror>
|
||||||
|
|
|
@ -6,4 +6,4 @@ variable.
|
||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
$ export UBUNTU_MIRROR=http://<local mirror hostname>/<path to mirror>
|
$ export FEDORA_MIRROR=http://<local mirror hostname>/<path to mirror>
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "" > /etc/resolv.conf
|
echo "" > /etc/resolv.conf
|
||||||
echo "" > /etc/resolv.conf.ORIG
|
echo "" > /etc/resolv.conf.ORIG
|
||||||
echo "#!/bin/sh
|
if [ -d /etc/dhcp/dhclient-enter-hooks.d ]
|
||||||
|
then
|
||||||
|
# Debian/Ubuntu
|
||||||
|
echo "#!/bin/sh
|
||||||
make_resolv_conf() { : ; }" > /etc/dhcp/dhclient-enter-hooks.d/noresolvconf
|
make_resolv_conf() { : ; }" > /etc/dhcp/dhclient-enter-hooks.d/noresolvconf
|
||||||
chmod +x /etc/dhcp/dhclient-enter-hooks.d/noresolvconf
|
chmod +x /etc/dhcp/dhclient-enter-hooks.d/noresolvconf
|
||||||
rm -f /etc/dhcp/dhclient-enter-hooks.d/resolvconf
|
rm -f /etc/dhcp/dhclient-enter-hooks.d/resolvconf
|
||||||
|
else
|
||||||
|
# RHEL/CentOS/Fedora
|
||||||
|
echo "#!/bin/sh
|
||||||
|
make_resolv_conf() { : ; }" > /etc/dhclient-enter-hooks
|
||||||
|
chmod +x /etc/dhclient-enter-hooks
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue