Skip to content

Commit

Permalink
Changing Rocky scripts for 8 and 9 and adding steps to preconfig scri…
Browse files Browse the repository at this point in the history
…pts for ceph
  • Loading branch information
Hutch-45D committed Dec 20, 2024
1 parent ea55aea commit 3e41899
Show file tree
Hide file tree
Showing 9 changed files with 464 additions and 12 deletions.
10 changes: 10 additions & 0 deletions rocky-offline-repo-switcher.sh → rocky8-offline-repo-switcher.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/bash

ID=$(grep -w ID= /etc/os-release | cut -d= -f2 | tr -d '"')
Platform=$(grep -w PLATFORM_ID= /etc/os-release | cut -d= -f2 | tr -d '"')

# Check if the OS is Rocky Linux 8
if [[ "$ID" != "rocky" || "$Platform" != "platform:el8" ]]; then
echo "OS is not Rocky8 Linux"
exit 1
fi

usage() {
echo "Options: e - Enable Offline Repos, d - Disable Offline Repos" >&2
}
Expand Down
78 changes: 75 additions & 3 deletions rocky-preconfig-ceph.sh → rocky8-preconfig-ceph.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#!/bin/bash

# Matthew Hutchinson <[email protected]>

# Rocky 8 System Configuration Tweaks for Cluster Nodes

ID=$(grep -w ID= /etc/os-release | cut -d= -f2 | tr -d '"')
Platform=$(grep -w PLATFORM_ID= /etc/os-release | cut -d= -f2 | tr -d '"')

# Check if the OS is Rocky Linux 8
if [[ "$ID" != "rocky" || "$Platform" != "platform:el8" ]]; then
echo "OS is not Rocky8 Linux"
exit 1
fi


interpreter=$(ps -p $$ | awk '$1 != "PID" {print $(NF)}' | tr -d '()')
Expand Down Expand Up @@ -31,7 +43,7 @@ Welcome to the
| ##| ######/| #######/| ## | ## \ #/ | ####### /#######/
|__/ \______/ |_______/ |__/ |__/ \_/ \_______/|_______/
Rocky Preconfiguration Script.
Rocky8 Preconfiguration Script.
This script will install epel-release, zfs, cockpit and add our repos. Houston UI will be
configured with our latest tools and packages.
Expand All @@ -56,6 +68,66 @@ EOF

setup_45drives_repo() {
local res

#Install Ceph Repo
read -p "What version of Ceph are you using (15/16/17): " response
if [[ "$response" == "15" ]]; then
echo "Configuring Ceph Stable repository for version 15"
cat <<EOF > /etc/yum.repos.d/ceph_stable.repo
[ceph_stable]
baseurl = http://download.ceph.com/rpm-octopus/el8/\$basearch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable \$basearch repo
priority = 2
[ceph_stable_noarch]
baseurl = http://download.ceph.com/rpm-octopus/el8/noarch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable noarch repo
priority = 2
EOF
elif [[ "$response" == "16" ]]; then
echo "Configuring Ceph Stable repository for version 16"
cat <<EOF > /etc/yum.repos.d/ceph_stable.repo
[ceph_stable]
baseurl = http://download.ceph.com/rpm-pacific/el8/\$basearch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable \$basearch repo
priority = 2
[ceph_stable_noarch]
baseurl = http://download.ceph.com/rpm-pacific/el8/noarch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable noarch repo
priority = 2
EOF
elif [[ "$response" == "17" ]]; then
echo "Configuring Ceph Stable repository for version 17"
cat <<EOF > /etc/yum.repos.d/ceph_stable.repo
[ceph_stable]
baseurl = http://download.ceph.com/rpm-17.2.7/el8/\$basearch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable \$basearch repo
priority = 2
[ceph_stable_noarch]
baseurl = http://download.ceph.com/rpm-17.2.7/el8/noarch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable noarch repo
priority = 2
EOF
else
echo "Invalid Selection, Please enter '15''16' or '17'"
exit
fi


#Install 45Drives Repository
echo "Downloading 45Drives Repo Setup Script"
curl -sSL https://repo.45drives.com/setup -o setup-repo.sh
Expand Down Expand Up @@ -108,7 +180,7 @@ houston_configuration() {
dnf -y install dnf-plugins-core
dnf config-manager --set-enabled powertools
dnf install -y cockpit cockpit-pcp cockpit-benchmark cockpit-navigator cockpit-file-sharing cockpit-45drives-hardware cockpit-identities cockpit-machines \
cockpit-sosreport cockpit-storaged cockpit-scheduler cockpit-zfs
cockpit-sosreport cockpit-storaged cockpit-scheduler
res=$?
if [[ $res != 0 ]]; then
echo "Error Installing Cockpit"
Expand Down Expand Up @@ -138,7 +210,7 @@ update_system() {
local res

echo "Updating system"
dnf update -y
dnf update --nobest -y
res=$?

if [[ $res != 0 ]]; then
Expand Down
9 changes: 9 additions & 0 deletions rocky-preconfig-offline.sh → rocky8-preconfig-offline.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/bash

ID=$(grep -w ID= /etc/os-release | cut -d= -f2 | tr -d '"')
Platform=$(grep -w PLATFORM_ID= /etc/os-release | cut -d= -f2 | tr -d '"')

# Check if the OS is Rocky Linux 8
if [[ "$ID" != "rocky" || "$Platform" != "platform:el8" ]]; then
echo "OS is not Rocky8 Linux"
exit 1
fi

interpreter=$(ps -p $$ | awk '$1 != "PID" {print $(NF)}' | tr -d '()')

if [ "$interpreter" != "bash" ]; then
Expand Down
20 changes: 18 additions & 2 deletions rocky-preconfig.sh → rocky8-preconfig.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/bash

# Matthew Hutchinson <[email protected]>


# Rocky 8 System Configuration Tweaks


ID=$(grep -w ID= /etc/os-release | cut -d= -f2 | tr -d '"')
Platform=$(grep -w PLATFORM_ID= /etc/os-release | cut -d= -f2 | tr -d '"')

# Check if the OS is Rocky Linux 8
if [[ "$ID" != "rocky" || "$Platform" != "platform:el8" ]]; then
echo "OS is not Rocky8 Linux"
exit 1
fi


interpreter=$(ps -p $$ | awk '$1 != "PID" {print $(NF)}' | tr -d '()')

if [ "$interpreter" != "bash" ]; then
Expand Down Expand Up @@ -29,7 +45,7 @@ Welcome to the
| ##| ######/| #######/| ## | ## \ #/ | ####### /#######/
|__/ \______/ |_______/ |__/ |__/ \_/ \_______/|_______/
Rocky Preconfiguration Script.
Rocky8 Preconfiguration Script.
This script will install epel-release, zfs, cockpit and add our repos. Houston UI will be
configured with our latest tools and packages.
Expand Down Expand Up @@ -178,7 +194,7 @@ update_system() {
local res

echo "Updating system"
dnf update -y
dnf update --nobest -y
res=$?

if [[ $res != 0 ]]; then
Expand Down
Loading

0 comments on commit 3e41899

Please sign in to comment.