Skip to content

Commit

Permalink
Merge pull request #129 from redhat-performance/installer-update
Browse files Browse the repository at this point in the history
Update Zathras installer
  • Loading branch information
grdumas authored Dec 17, 2024
2 parents 9900f22 + 39a53c8 commit 733b196
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

set -eu

# Check if script is being run as root
if (( $EUID == 0 )); then
read -p "For most use cases, running this script as root is NOT recommended. Are you sure? Y/N" yesno
read -p "For most use cases, running this script as root is NOT recommended. Are you sure? Y/N " yesno

case $yesno in
[Yy]* )
Expand All @@ -39,9 +41,6 @@ packages=(ansible-core git jq python python3-pip terraform wget)
for package in "${packages[@]}"; do
if dnf list installed "$package" &> /dev/null; then
echo "$package is installed."
elif dnf list "$package" &> /dev/null; then
echo "$package is not installed but available. Installing..."
sudo dnf install -y "$package"
elif [ $package == "terraform" ]; then
# Add the terraform repository from HashiCorp
# currently supported distros: fedora, RHEL
Expand All @@ -67,17 +66,36 @@ for package in "${packages[@]}"; do
sudo dnf config-manager --add-repo $repo_url

# install the package
sudo dnf install terraform -y
sudo dnf install terraform-1.9.8-1 -y || {
exit 1
}
else
echo "package $package is not installed and not available."
echo "Installing $package..."
sudo dnf install -y "$package" || {
exit 1
}
fi

done



# pip install requirements
pip3 install boto boto3 --user
pip3 install 'yq==2.10.0' --user
python_packages=(boto boto3 'yq==2.10.0')
for package in "${python_packages[@]}"; do
pip3 install "$package" --user || {
exit 1
}
done


# install AWS collection for ansible
ansible_collections=(amazon.aws)
for collection in "${ansible_collections[@]}"; do
ansible-galaxy collection install "$collection" || {
exit 1
}
done


echo "Before you can run Zathras:"
Expand Down

0 comments on commit 733b196

Please sign in to comment.