From 33335b449b49dd9a61436449862cd7d094e2199d Mon Sep 17 00:00:00 2001 From: Telles Nobrega Date: Sat, 10 Mar 2018 07:11:18 -0300 Subject: [PATCH] Adding support for RHEL images Adding support for rhel images on the image generation system. Note.: It is necessary to previous to start packing the image for the user to register the image using virt-costumize and also enable the necessary REPOS. Change-Id: Ia8c483d34a26ba0ccfe25b5496cc03af4c1b7808 --- doc/source/contributor/image-gen.rst | 11 +++++++++++ sahara/plugins/ambari/resources/images/image.yaml | 6 +++--- .../plugins/cdh/v5_11_0/resources/images/image.yaml | 8 ++++---- sahara/plugins/cdh/v5_7_0/resources/images/image.yaml | 8 ++++---- sahara/plugins/cdh/v5_9_0/resources/images/image.yaml | 8 ++++---- sahara/plugins/images.py | 1 + sahara/plugins/mapr/resources/images/image.yaml | 4 ++-- 7 files changed, 29 insertions(+), 17 deletions(-) diff --git a/doc/source/contributor/image-gen.rst b/doc/source/contributor/image-gen.rst index 394e249efd..21901d27ac 100644 --- a/doc/source/contributor/image-gen.rst +++ b/doc/source/contributor/image-gen.rst @@ -51,6 +51,7 @@ the image packing feature. Plugins may require their own arguments at specific versions; use the ``--help`` feature with ``PLUGIN`` and ``VERSION`` to see the appropriate argument structure. + a plausible command-line invocation would be: :: @@ -70,6 +71,16 @@ will first describe how to modify an image packing specification for one of the plugins, and second, how to enable the image packing feature for new or existing plugins. +Note: In case of a RHEL 7 images, it is necessary to register the image before +starting to pack it, also enable some required repos. + +:: + + virt-customize -v -a $SAHARA_RHEL_IMAGE --sm-register \ + --sm-credentials ${REG_USER}:password:${REG_PASSWORD} --sm-attach \ + pool:${REG_POOL_ID} --run-command 'subscription-manager repos \ + --disable=* --enable=$REPO_A \ --enable=$REPO_B \ --enable=$REPO_C' + Dev notes on the CLI itself ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/sahara/plugins/ambari/resources/images/image.yaml b/sahara/plugins/ambari/resources/images/image.yaml index c597e9eaa9..010f26e1f2 100644 --- a/sahara/plugins/ambari/resources/images/image.yaml +++ b/sahara/plugins/ambari/resources/images/image.yaml @@ -30,7 +30,7 @@ validators: oracle-java: - script: common/oracle_java - os_case: - - centos: + - redhat: - script: centos/disable_selinux - script: centos/disable_certificate_check - script: @@ -77,7 +77,7 @@ validators: - rng-tools - iptables-services - os_case: - - centos: + - redhat: - script: centos/disable_ambari - script: centos/disable_firewall - script: @@ -91,7 +91,7 @@ validators: common/add_jar: env_vars: [hdfs_lib_dir, swift_url] - os_case: - - centos: + - redhat: - package: - krb5-server - krb5-libs diff --git a/sahara/plugins/cdh/v5_11_0/resources/images/image.yaml b/sahara/plugins/cdh/v5_11_0/resources/images/image.yaml index 1aa588a03a..9dc81c7a2c 100644 --- a/sahara/plugins/cdh/v5_11_0/resources/images/image.yaml +++ b/sahara/plugins/cdh/v5_11_0/resources/images/image.yaml @@ -27,7 +27,7 @@ arguments: validators: - script: common/install_extjs - os_case: - - centos: + - redhat: - package: wget - script: centos/wget_repo: @@ -75,7 +75,7 @@ validators: - oozie - spark-core - os_case: - - centos: + - redhat: - package: spark-history-server - package: zookeeper - package: unzip @@ -101,7 +101,7 @@ validators: common/install_cloudera: env_vars: [plugin_version] - os_case: - - centos: + - redhat: - script: centos/turn_off_services - ubuntu: - script: ubuntu/turn_off_services @@ -112,7 +112,7 @@ validators: common/unlimited_security_artifacts: env_vars: [unlimited_security_location] - os_case: - - centos: + - redhat: - package: - krb5-server - krb5-libs diff --git a/sahara/plugins/cdh/v5_7_0/resources/images/image.yaml b/sahara/plugins/cdh/v5_7_0/resources/images/image.yaml index 309bd44240..aab7f1498a 100644 --- a/sahara/plugins/cdh/v5_7_0/resources/images/image.yaml +++ b/sahara/plugins/cdh/v5_7_0/resources/images/image.yaml @@ -30,7 +30,7 @@ arguments: validators: - script: common/install_extjs - os_case: - - centos: + - redhat: - package: wget - script: centos/wget_repo - ubuntu: @@ -76,7 +76,7 @@ validators: - oozie - spark-core - os_case: - - centos: + - redhat: - package: spark-history-server - package: zookeeper - package: unzip @@ -102,7 +102,7 @@ validators: common/install_cloudera: env_vars: [plugin_version] - os_case: - - centos: + - redhat: - script: centos/turn_off_services - ubuntu: - script: ubuntu/turn_off_services @@ -113,7 +113,7 @@ validators: common/unlimited_security_artifacts: env_vars: [unlimited_security_location] - os_case: - - centos: + - redhat: - package: - krb5-server - krb5-libs diff --git a/sahara/plugins/cdh/v5_9_0/resources/images/image.yaml b/sahara/plugins/cdh/v5_9_0/resources/images/image.yaml index 4d912f4408..2e20e5201e 100644 --- a/sahara/plugins/cdh/v5_9_0/resources/images/image.yaml +++ b/sahara/plugins/cdh/v5_9_0/resources/images/image.yaml @@ -28,7 +28,7 @@ arguments: validators: - script: common/install_extjs - os_case: - - centos: + - redhat: - package: wget - script: centos/wget_repo: @@ -76,7 +76,7 @@ validators: - oozie - spark-core - os_case: - - centos: + - redhat: - package: spark-history-server - package: zookeeper - package: unzip @@ -102,7 +102,7 @@ validators: common/install_cloudera: env_vars: [plugin_version] - os_case: - - centos: + - redhat: - script: centos/turn_off_services - ubuntu: - script: ubuntu/turn_off_services @@ -113,7 +113,7 @@ validators: common/unlimited_security_artifacts: env_vars: [unlimited_security_location] - os_case: - - centos: + - redhat: - package: - krb5-server - krb5-libs diff --git a/sahara/plugins/images.py b/sahara/plugins/images.py index f5a1deeaba..27654a47db 100644 --- a/sahara/plugins/images.py +++ b/sahara/plugins/images.py @@ -186,6 +186,7 @@ class SaharaImageValidatorBase(ImageValidator): 'centos7': 'redhat', 'fedora': 'redhat', 'redhat': 'redhat', + 'rhel': 'redhat', 'redhatenterpriseserver': 'redhat', 'ubuntu': 'debian' } diff --git a/sahara/plugins/mapr/resources/images/image.yaml b/sahara/plugins/mapr/resources/images/image.yaml index 5b3bf39f07..d99c971ea0 100644 --- a/sahara/plugins/mapr/resources/images/image.yaml +++ b/sahara/plugins/mapr/resources/images/image.yaml @@ -33,7 +33,7 @@ validators: - wget - zip - os_case: - - centos: + - redhat: - package: - cups - cdparanoia-libs @@ -145,7 +145,7 @@ validators: - zlib1g-dev - script: common/configure_extjs - os_case: - - centos: + - redhat: - copy_script: common/resources/package_utils.sh - copy_script: common/resources/packages.json - copy_script: common/resources/spec_5.1.0.json