2023-03-15 08:58:12 +00:00
|
|
|
# Shows help
|
|
|
|
default:
|
2023-03-25 13:40:07 +00:00
|
|
|
@just --list --justfile {{ justfile() }}
|
2023-03-15 08:58:12 +00:00
|
|
|
|
|
|
|
# Pulls external Ansible roles
|
|
|
|
roles:
|
2023-03-25 14:15:08 +00:00
|
|
|
#!/usr/bin/env sh
|
2023-03-25 13:40:07 +00:00
|
|
|
if [ -x "$(command -v agru)" ]; then
|
|
|
|
agru
|
|
|
|
else
|
|
|
|
rm -rf roles/galaxy
|
|
|
|
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
|
|
|
fi
|
2023-03-15 08:58:12 +00:00
|
|
|
|
2023-03-25 13:41:54 +00:00
|
|
|
# Updates requirements.yml if there are any new tags available. Requires agru
|
2023-07-22 08:27:49 +00:00
|
|
|
update: && opml
|
2023-03-25 14:50:46 +00:00
|
|
|
@agru -u
|
2023-03-25 13:41:54 +00:00
|
|
|
|
2023-03-15 08:58:12 +00:00
|
|
|
# Runs ansible-lint against all roles in the playbook
|
|
|
|
lint:
|
2023-03-25 13:40:07 +00:00
|
|
|
ansible-lint
|
2023-03-15 08:58:12 +00:00
|
|
|
|
2023-07-22 08:27:49 +00:00
|
|
|
# dumps an OPML file with extracted git feeds for roles
|
|
|
|
opml:
|
|
|
|
@echo "generating opml..."
|
|
|
|
@python bin/feeds.py . dump
|
|
|
|
|
2023-03-15 08:58:12 +00:00
|
|
|
# Runs the playbook with --tags=install-all,start and optional arguments
|
|
|
|
install-all *extra_args: (run-tags "install-all,start" extra_args)
|
|
|
|
|
|
|
|
# Runs installation tasks for a single service
|
2023-03-20 12:45:27 +00:00
|
|
|
install-service service *extra_args:
|
2023-03-28 07:52:48 +00:00
|
|
|
just --justfile {{ justfile() }} run \
|
|
|
|
--tags=install-{{ service }},start-group \
|
|
|
|
--extra-vars=group={{ service }} \
|
|
|
|
--extra-vars=devture_systemd_service_manager_service_restart_mode=one-by-one {{ extra_args }}
|
2023-03-15 08:58:12 +00:00
|
|
|
|
|
|
|
# Runs the playbook with --tags=setup-all,start and optional arguments
|
|
|
|
setup-all *extra_args: (run-tags "setup-all,start" extra_args)
|
|
|
|
|
|
|
|
# Runs the playbook with the given list of arguments
|
|
|
|
run +extra_args:
|
2023-04-01 03:33:54 +00:00
|
|
|
ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
|
2023-03-15 08:58:12 +00:00
|
|
|
|
|
|
|
# Runs the playbook with the given list of comma-separated tags and optional arguments
|
|
|
|
run-tags tags *extra_args:
|
2023-03-25 13:40:07 +00:00
|
|
|
just --justfile {{ justfile() }} run --tags={{ tags }} {{ extra_args }}
|
2023-03-15 08:58:12 +00:00
|
|
|
|
|
|
|
# Starts all services
|
|
|
|
start-all *extra_args: (run-tags "start-all" extra_args)
|
|
|
|
|
|
|
|
# Starts a specific service group
|
|
|
|
start-group group *extra_args:
|
2023-03-25 13:40:07 +00:00
|
|
|
@just --justfile {{ justfile() }} run-tags start-group --extra-vars="group={{ group }}" {{ extra_args }}
|
2023-03-15 08:58:12 +00:00
|
|
|
|
|
|
|
# Stops all services
|
|
|
|
stop-all *extra_args: (run-tags "stop-all" extra_args)
|
|
|
|
|
|
|
|
# Stops a specific service group
|
|
|
|
stop-group group *extra_args:
|
2023-03-25 13:40:07 +00:00
|
|
|
@just --justfile {{ justfile() }} run-tags stop-group --extra-vars="group={{ group }}" {{ extra_args }}
|