60 lines
1.6 KiB
Makefile
60 lines
1.6 KiB
Makefile
set dotenv-load
|
|
|
|
# Default: list available recipes
|
|
default:
|
|
@just --list
|
|
|
|
# Install Ansible Galaxy collections
|
|
deps:
|
|
ansible-galaxy collection install -r requirements.yml
|
|
|
|
# Set up the target host: install Docker and create the sovereign network
|
|
setup-host:
|
|
ansible-playbook playbooks/site.yml --tags common
|
|
|
|
# Run molecule tests for all roles
|
|
test:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
roles=(authentik common dns forgejo graylog headscale jitsi matrix minio nextcloud roundcube stalwart vaultwarden wazuh website)
|
|
failed=()
|
|
for role in "${roles[@]}"; do
|
|
echo "==> Testing role: $role"
|
|
if ! (cd roles/$role && molecule test); then
|
|
failed+=("$role")
|
|
fi
|
|
done
|
|
if [ ${#failed[@]} -gt 0 ]; then
|
|
echo "FAILED roles: ${failed[*]}"
|
|
exit 1
|
|
fi
|
|
echo "All molecule tests passed."
|
|
|
|
# Run molecule tests for a single role: just test-role common
|
|
test-role role:
|
|
cd roles/{{ role }} && molecule test
|
|
|
|
# Update an existing deployment (pull latest config, re-run all roles)
|
|
update:
|
|
ansible-playbook playbooks/site.yml
|
|
|
|
# Update a single service: just update-service authentik
|
|
update-service service:
|
|
ansible-playbook playbooks/site.yml --tags {{ service }}
|
|
|
|
# Dry-run the full deployment
|
|
check:
|
|
ansible-playbook playbooks/site.yml --check --diff
|
|
|
|
# Lint the project
|
|
lint:
|
|
ansible-lint
|
|
|
|
# Interactively generate a new group_vars/all.yml for a deployment
|
|
configure:
|
|
python3 configure.py
|
|
|
|
# Generate group_vars to a custom path: just configure-to /tmp/all.yml
|
|
configure-to path:
|
|
python3 configure.py -o {{ path }}
|