diff --git a/elements/rhel-common/README.md b/elements/rhel-common/README.md new file mode 100644 index 00000000..64eb571b --- /dev/null +++ b/elements/rhel-common/README.md @@ -0,0 +1 @@ +This element contains the common installation steps between RHEL os releases. diff --git a/elements/rhel/pre-install.d/00-rhsm b/elements/rhel-common/pre-install.d/00-rhsm similarity index 90% rename from elements/rhel/pre-install.d/00-rhsm rename to elements/rhel-common/pre-install.d/00-rhsm index db1dd24d..274244a5 100755 --- a/elements/rhel/pre-install.d/00-rhsm +++ b/elements/rhel-common/pre-install.d/00-rhsm @@ -44,7 +44,11 @@ if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ] ; then subscription-manager attach --pool $DIB_RHSM_POOL fi # optional repo required for diskimage-builder dependency - repos="--enable rhel-6-server-optional-rpms" + if [ "$DISTRO_NAME" == "rhel7" ]; then + repos="--enable rhel-7-server-optional-rpms" + else + repos="--enable rhel-6-server-optional-rpms" + fi if [[ -n "$DIB_RHSM_REPOS" ]]; then for repo in $DIB_RHSM_REPOS; do repos="$repos --enable $repo" diff --git a/elements/rhel/pre-install.d/10-rhel-blacklist b/elements/rhel-common/pre-install.d/10-rhel-blacklist similarity index 100% rename from elements/rhel/pre-install.d/10-rhel-blacklist rename to elements/rhel-common/pre-install.d/10-rhel-blacklist diff --git a/elements/rhel/element-deps b/elements/rhel/element-deps index e5228c33..66b94cc8 100644 --- a/elements/rhel/element-deps +++ b/elements/rhel/element-deps @@ -1,4 +1,5 @@ cache-url dib-run-parts +rhel-common rpm-distro yum diff --git a/elements/rhel7/element-deps b/elements/rhel7/element-deps index c6e5925f..4f33c20e 100644 --- a/elements/rhel7/element-deps +++ b/elements/rhel7/element-deps @@ -1,6 +1,7 @@ cache-url dib-run-parts redhat-common +rhel-common rpm-distro source-repositories yum