-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·39 lines (35 loc) · 1.11 KB
/
bootstrap
File metadata and controls
executable file
·39 lines (35 loc) · 1.11 KB
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
34
35
36
37
38
39
#!/usr/bin/env bash
#
## Usage:
#
# ./bootstrap
#
# This script installs the dependencies necessary to run the playbooks
#
# We use uv to manage the python dependencies and install ansible
# then we use ./run to access ansible easily
# The idea is to avoid installing ansible at the user level and keep install
# at the project level
# Ideally we want to use curl, but on some installs we
# only have wget. Detect and use what's available.
CURL=
if type curl >/dev/null; then
CURL="curl -LsSf"
elif type wget >/dev/null; then
echo 'curl not found trying to use wget instead'
CURL="wget -q -O-"
fi
if [ -z "$CURL" ]; then
echo "The installer needs either curl or wget to download files."
echo "Please install either curl or wget to proceed."
exit 1
fi
# Install uv
$CURL https://astral.sh/uv/install.sh | sh
# Get uv in the path
source "$HOME/.local/bin/env"
cp inventory.sample inventory
# Once ansible is installed install the plugins
# TODO There is probably a better way to do that
uv run -- ansible-galaxy collection install community.general
uv run -- ansible-galaxy collection install community.docker