Init Commit

This commit is contained in:
2023-03-27 18:39:51 -04:00
parent 1c0bb08c9f
commit c6e5a56ba6
13 changed files with 805 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
# This script will do an offline install of ansible.
# It requires that the variable ANSIBLE_RPMS_TAR_GZ be set to the path of a
# tar.gz file containing RPMs for Ansible and it's dependencies.
# TODO Combine this and other rpm tar.gz archives.
set -u
# Make sure our environment variable is set before using it and creating a
# temporary directory.
stat "$ANSIBLE_RPMS_TAR_GZ"
# Create a temporary location to extract the RPMs to.
mkdir tmp
# Extract the RPM tar.gz file to a temporary directory.
tar xvzf "$ANSIBLE_RPMS_TAR_GZ" -C ./tmp
# Perform a localinstall of all the RPMs extracted from ANSIBLE_RPMS_TAR_GZ.
#
# Ignore the shellshock error about quoting the find, because in this case we
# don't the string to split.
# shellcheck disable=SC2046
yum localinstall --disablerepo=* --nogpgcheck -y $(find ./tmp -name "*.rpm")
# Delete the temporary RPM package.
rm -rf tmp
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
# This script will do an offline install of packages that are included in
# RPM_TAR_GZS. Every RPM file in the archives will be installed. RPM_TAR_GZS
# must be defined and it needs to be a space delimited list of RPM archives.
set -u
echo "Installing RPMs from archives: $RPM_TAR_GZS"
# Create a temporary directory where all archives in $RPM_TAR_GZS will be
# extracted to.
mkdir tmp
# For each archive in RPM_TAR_GZS extract the contents to ./tmp
for ARCHIVE in $RPM_TAR_GZS; do
tar xvf "$ARCHIVE" -C tmp/
done
# Perform a localinstall of all the RPMs extracted from RPM_TAR_GZS.
#
# Ignore the shellshock error about quoting the find, because in this case we
# don't the string to split.
# shellcheck disable=SC2046
yum localinstall --disablerepo=* --nogpgcheck -y $(find ./tmp -name "*.rpm")
# Delete the temporary RPM packages.
rm -rf tmp
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
# This script will do an offline install of the packages defined by PIP_PKGS and
# will install them from the tar.gzs defined by PIP_TARS_GZS. These variables
# must be defined and each of them should be a space delimited list.
set -u
# TODO REM add a way to configure python.
echo "Installing packages \"$PIP_PKGS\" from archives: $PIP_TARS_GZS"
# Create temporary directories.
#
# Archives defined on PIP_TARS_GZS are extracted to `tmp`. The wheel files are
# pulled out of `tmp` and put into `wheels`.
mkdir tmp wheels
# For each archive in PIP_TARS_GZS, extract the contents into tmp.
for ARCHIVE in $PIP_TARS_GZS; do
tar xvzf "$ARCHIVE" -C tmp/
done
# Find all the `whl` files and copy them into `wheels`.
find tmp -name "*.whl" -exec cp {} wheels/ \;
# Install all packages defined in PIP_PKGS.
#
# shellcheck disable=SC2086
pip install \
--no-index \
--find-links=wheels/ \
$PIP_PKGS
# Remove temporary directories.
rm -rf tmp wheels
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
set -u
# This script will do an offline install of python.
# It requires that the variable PYTHON_RPMS_TAR_GZ be set to the path of a
# tar.gz file containing RPMs for python and it's dependencies.
PROFILE_D_PYTHON=/etc/profile.d/python-scl.sh
echo "Installing python from RPMs in $PYTHON_RPMS_TAR_GZ"
# Create a temporary location to extract the RPMs to.
mkdir tmp
# Extract the RPM tar.gz file to a temporary directory.
tar xvzf "$PYTHON_RPMS_TAR_GZ" -C ./tmp
# Perform a localinstall of all the RPMs extracted from PYTHON_RPMS_TAR_GZ.
#
# Ignore the shellshock error about quoting the find, because in this case we
# don't the string to split.
# shellcheck disable=SC2046
yum localinstall --disablerepo=* --nogpgcheck -y $(find ./tmp -name "*.rpm")
# Delete the temporary RPM package.
rm -rf tmp
# Add this to /etc/profile.d so that this python version will get loaded
# automatically when a user logs in.
echo "source /opt/rh/rh-python38/enable" | tee "$PROFILE_D_PYTHON"
chown root:root "$PROFILE_D_PYTHON"
chmod 644 "$PROFILE_D_PYTHON"