intial centos(el8) support added

This commit is contained in:
2021-01-16 18:16:15 +01:00
parent e0e312c393
commit c3269c29f3
3 changed files with 56 additions and 13 deletions

View File

@@ -0,0 +1,6 @@
[mongodb-org-MOGOVER]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/MOGOVER/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-MOGOVER.asc

View File

@@ -0,0 +1,12 @@
module mongodb_cgroup_memory 1.0;
require {
type cgroup_t;
type mongod_t;
class dir search;
class file { getattr open read };
}
#============= mongod_t ==============
allow mongod_t cgroup_t:dir search;
allow mongod_t cgroup_t:file { getattr open read };

View File

@@ -1,3 +1,6 @@
#!/bin/bash
##Script build for debian (10), ubuntu (18.04,20.04) and centos (8)
##Build of a release tag ##Build of a release tag
#RelVer=stable #RelVer=stable
##Build of a master branch, but config is vaidated ##Build of a master branch, but config is vaidated
@@ -5,7 +8,7 @@ RelVer=latest_Tested
##Build of a master branch ##Build of a master branch
#RelVer=latest #RelVer=latest
#Use 3.6, or lower (only avalible on ubuntu 18.04 or debian 9) for current 'stable' release (v0.4.2), #Use 3.6 (only avalible on ubuntu 18.04, centos 8 or debian 9) for current 'stable' release (v0.4.2),
#4.4 works on current 'latest' and ' latest_Tested' #4.4 works on current 'latest' and ' latest_Tested'
MongoVer=4.4 MongoVer=4.4
@@ -14,20 +17,42 @@ cd "$(dirname "$0")"
#Setting up services needed for ShellHub #Setting up services needed for ShellHub
##PreReqs ##PreReqs
mkdir -p /opt/ShellHub/{ui,keys,tools} mkdir -p /opt/ShellHub/{ui,keys,tools}
apt-get -y install --no-install-recommends wget gnupg ca-certificates openssl uuid-runtime
###addding mongoDB and openresty Repos
wget -O - https://openresty.org/package/pubkey.gpg | apt-key add - if [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "debian" ] || [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "ubuntu" ]; then
wget -qO - https://www.mongodb.org/static/pgp/server-$MongoVer.asc | apt-key add - PKGM=apt
if [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "debian" ]; then $PKGM -y install --no-install-recommends wget gnupg ca-certificates openssl uuid-runtime
echo "deb http://openresty.org/package/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"') openresty" > /etc/apt/sources.list.d/openresty.list ###debian/ubuntu prep
echo "deb http://repo.mongodb.org/apt/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/$MongoVer main" > /etc/apt/sources.list.d/mongodb-org-$MongoVer.list ####addding mongoDB and openresty Repos
elif [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "ubuntu" ]; then wget -O - https://openresty.org/package/pubkey.gpg | apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/$MongoVer multiverse" > /etc/apt/sources.list.d/mongodb-org-$MongoVer.list wget -qO - https://www.mongodb.org/static/pgp/server-$MongoVer.asc | apt-key add -
echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/openresty.list if [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "debian" ]; then
echo "deb http://openresty.org/package/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"') openresty" > /etc/apt/sources.list.d/openresty.list
echo "deb http://repo.mongodb.org/apt/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/$MongoVer main" > /etc/apt/sources.list.d/mongodb-org-$MongoVer.list
elif [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "ubuntu" ]; then
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/$MongoVer multiverse" > /etc/apt/sources.list.d/mongodb-org-$MongoVer.list
echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/openresty.list
fi
apt update
elif [ "$(grep -oP '(?<=^PLATFORM_ID=).+' /etc/os-release | tr -d '"')" = "platform:el8" ]; then
###el8 prep
PKGM=dnf
####addding mongoDB and openresty Repos
$PKGM -y install --no-install-recommends wget gnupg ca-certificates openssl uuid checkpolicy
wget https://openresty.org/package/centos/openresty.repo
rpm --import https://openresty.org/package/pubkey.gpg
sed -i 's/MOGOVER/'$MongoVer'/g' config/EL8/mongodb.repo
mv config/EL8/mongodb.repo /etc/yum.repos.d/mongodb-org-$MongoVer.repo
$PKGM check-update --refresh
useradd -r -U -s /usr/sbin/nologin -d /var/www www-data
###adding selinux module
checkmodule -M -m -o /tmp/mongodb.mod config/EL8/mongodb.te
semodule_package -o /tmp/mongodb.pp -m /tmp/mongodb.mod
semodule -i /tmp/mongodb.pp
fi fi
##Installing packages ##Installing packages
apt-get update $PKGM install -y openresty openresty-opm mongodb-org
apt install -y openresty openresty-opm mongodb-org
##Configuring external services ##Configuring external services
opm get bungle/lua-resty-template opm get bungle/lua-resty-template
systemctl stop openresty mongod systemctl stop openresty mongod