-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
33 lines (25 loc) · 783 Bytes
/
setup.sh
File metadata and controls
33 lines (25 loc) · 783 Bytes
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
33
#!/bin/bash
set -e
echo "=========================================="
echo " Ubuntu Provisioning Bootstrap "
echo "=========================================="
if [ "$(id -u)" -eq 0 ]; then
SUDO=""
else
SUDO="sudo"
fi
echo "Updating system..."
$SUDO apt update
echo "Installing prerequisites (git, curl, software-properties-common)..."
$SUDO apt install -y software-properties-common git curl
if ! command -v ansible >/dev/null 2>&1; then
echo "Adding Ansible PPA..."
$SUDO apt-add-repository --yes --update ppa:ansible/ansible
echo "Installing Ansible..."
$SUDO apt install -y ansible
else
echo "Ansible already installed, skipping..."
fi
echo "Running Ansible Playbook..."
ansible-playbook playbook.yml -K
echo "Provisioning completed successfully!"