forked from playingfield/controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.sh
executable file
·32 lines (32 loc) · 1.14 KB
/
controller.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash -eux
# vagrant inventory, do not use for production
# Runs on a RHEL8 VM
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 dnf upgrade almalinux-release -y
sudo dnf makecache
# ansible-core installs python3.x and git-core
sudo dnf install -y ansible-core
# For platform-python for remote use.
sudo dnf install -y python3-jmespath python3-requests
# Install Python tools
sudo dnf install -y python3.12-pip python3.12-devel gcc
fi
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)
cd controller && source ansible.sh && ./prepare.sh
# export these variables!
if [ -z "${DB_PASS}" ]; then
export DB_PASS="your_database_password"
fi
if [ -z "${SSH_PASS}" ]; then
export SSH_PASS="KeyWillBeGeneratedWithAPassphrase"
fi
./provision.yml -v -e debug=true