Skip to content

Commit

Permalink
Clone self for Vagrant and Packer
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaassssiiee committed Jan 16, 2025
1 parent 8ba16bd commit 013acde
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions controller.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash -e
# vagrant inventory, do not use for production
# Runs on a RHEL8 VM
# dir of script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";

if [ -e /etc/redhat-release ]; then
major=$(tr -dc '0-9.' < /etc/redhat-release | cut -d \. -f1)
if ((major == 8))
then
# Update the GPG keys before any other dnf/yum task
sudo rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
sudo rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux || /bin/true
sudo dnf upgrade almalinux-release -y
sudo dnf makecache
# ansible-core installs python3.x and git-core
Expand All @@ -20,7 +23,11 @@ fi
# /etc/alternatives/pip3 will point to 3.6, ansible uses 3.12
sudo pip3.12 install jmespath
ansible --version
(git clone https://github.com/playingfield/controller.git || /bin/true)

if [ ! -d "$SCRIPT_DIR/.git" ]; then
echo 'Running in Packer or Vagrant'
(git clone https://github.com/playingfield/controller.git || /bin/true)
fi
cd controller && source ansible.sh && ./prepare.sh
# export these variables!
if [ -z "${DB_PASS}" ]; then
Expand Down

0 comments on commit 013acde

Please sign in to comment.