Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Zathras installer #129

Merged
merged 7 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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