From b1aa0c42fdc6c5ae26a38d81da9c032a9033f6ed Mon Sep 17 00:00:00 2001
From: Evgeny Antyshev <eantyshev@virtuozzo.com>
Date: Thu, 13 Aug 2015 14:11:07 +0000
Subject: [PATCH] Support CloudLinux in install_puppet.sh

CloudLinux is a commercial RHEL-based distribution
aimed specifically at web-hosting usage.
You may read about more: https://www.cloudlinux.com/about/compatibility.php

We need to test CloudLinux in VMs in our third-party CI,
and hence to customize VM images with diskimage-builder,
We use Openstack Infrastructure elements from openstack-infra/project-config.
Element for installing puppet (puppet/install.d/05-puppet) references
this script.

It is cumbersome to maintain a copy of this file locally, so
we propose this trivial change which will make
install_puppet.sh work for CloudLinux.

In case someone doesn't have CloudLinux at hand,
it has a version file like:
> cat /etc/redhat-release
CloudLinux release 7.1 (Vladimir Komarov)
> ls -la /etc/redhat-release
lrwxrwxrwx 1 root root 18 Jul 17 14:03 /etc/redhat-release -> cloudlinux-release

Change-Id: I01285d92d823b5e4fb4943bc31ff3ec6361eb5a2
---
 install_puppet.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install_puppet.sh b/install_puppet.sh
index 4baa934fd8..8227177396 100755
--- a/install_puppet.sh
+++ b/install_puppet.sh
@@ -29,13 +29,13 @@ function is_fedora {
 
 function is_rhel6 {
     [ -f /usr/bin/yum ] && \
-        cat /etc/*release | grep -q -e "Red Hat" -e "CentOS" && \
+        cat /etc/*release | grep -q -e "Red Hat" -e "CentOS" -e "CloudLinux" && \
         cat /etc/*release | grep -q 'release 6'
 }
 
 function is_rhel7 {
     [ -f /usr/bin/yum ] && \
-        cat /etc/*release | grep -q -e "Red Hat" -e "CentOS" && \
+        cat /etc/*release | grep -q -e "Red Hat" -e "CentOS" -e "CloudLinux" && \
         cat /etc/*release | grep -q 'release 7'
 }