feat!(tasks): move tasks to include; move dependencies installation to a task;...

This commit is contained in:
NaeiKinDus 2025-01-26 22:52:14 +00:00
parent 846f5e693e
commit 35d72db683
8 changed files with 161 additions and 103 deletions

View file

@ -19,57 +19,41 @@ thoroughly reviewed it, especially the system hardening and security tweaks that
# Usage
## Prerequisites
***Required dependencies***
- Python3.9+,
- PIP,
- Python3 venv
- curl or similar,
- python3.9+,
- [go-task](https://github.com/go-task/task) (or follow the instructions below to install it),
***Dependencies installed using the `Installation` instructions***
- [Task](https://taskfile.dev/),
- Debian packages:
- curl
- libcurl4-openssl-dev,
- libssl-dev,
- libcairo2,
- libcairo2-dev,
- libffi-dev,
- python3-dev,
- python3-venv
***Optional, dev-related dependencies***
- Docker
## Installation
```shell
# Debian amd64
sudo apt install -y \
curl \
libcurl4-openssl-dev \
libssl-dev \
libcairo2 \
libcairo2-dev \
libffi-dev \
python3-venv \
python3-dev;
# To install Task for a Debian (amd64) based system you can execute the following
TEMP_WORKDIR=$(mktemp -d)
cd "${TEMP_WORKDIR}"
# retrieve the latest available version's tag
TASK_VERSION=$(curl -fsSL -XGET https://api.github.com/repos/go-task/task/releases/latest | grep tag_name | tr -d ' ",' | cut -d ':' -f 2)
curl -fsSLO https://github.com/go-task/task/releases/download/"${TASK_VERSION}"/task_linux_amd64.deb;
sudo dpkg -i task_linux_amd64.deb;
rm task_linux_amd64.deb;
# retrieve the Debian archive
curl -fsSLO https://github.com/go-task/task/releases/download/"${TASK_VERSION}"/task_linux_amd64.deb
# retrieve the checksums file
curl -fsSLO https://github.com/go-task/task/releases/download/"${TASK_VERSION}/"task_checksums.txt
# ensure the downloaded archive is OK
sha256sum -c task_checksums.txt --ignore-missing
# install the tool
sudo dpkg -i ./task_linux_amd64.deb
cd -
rm -r "${TEMP_WORKDIR}"
unset TEMP_WORKDIR
```
## Setup
```shell
# Generate default ansible configuration
./scripts/generate_ansible_config.sh > "${HOME}"/.ansible.cfg
./scripts/generate_ansible_config.sh ./ansible.cfg
# Setup Python virtual env
task venv:setup
# Setup the project
task setup
# additionally install the dev dependencies if you need them
task setup:dev
# Prepare and edit your inventory as needed
cp inventory/inventory.yml.dist inventory/inventory.yml
# Prepare and edit the global vault as needed
cp inventory/vault.yml.dist inventory/vault.yml
```
## Using Tasks
@ -145,3 +129,6 @@ Global variables are defined in `inventory/group_vars/all/vars.yml` and are used
- inventory: all inventory related files are stored here;
- playbooks: top level playbooks, describe the way the infrastructure is laid out;
- scripts: various scripts and helpers;
# TODO / Issues
- gpg setup for HC Vault should be done with current user or root only, not mixed