2023-01-11 15:05:49 +02:00
|
|
|
# Shows help
|
|
|
|
default:
|
2023-03-25 17:47:13 +02:00
|
|
|
@just --list --justfile {{ justfile() }}
|
2023-01-11 15:05:49 +02:00
|
|
|
|
|
|
|
# Pulls external Ansible roles
|
|
|
|
roles:
|
2023-03-25 17:47:13 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
if [ -x "$(command -v agru)" ]; then
|
|
|
|
agru
|
|
|
|
else
|
|
|
|
rm -rf roles/galaxy
|
|
|
|
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Updates requirements.yml if there are any new tags available. Requires agru
|
|
|
|
update:
|
|
|
|
@agru -u
|
2023-01-11 15:05:49 +02:00
|
|
|
|
|
|
|
# Runs ansible-lint against all roles in the playbook
|
|
|
|
lint:
|
2023-03-25 17:47:13 +02:00
|
|
|
ansible-lint
|
2023-01-11 15:05:49 +02:00
|
|
|
|
|
|
|
# Runs the playbook with --tags=install-all,ensure-matrix-users-created,start and optional arguments
|
|
|
|
install-all *extra_args: (run-tags "install-all,ensure-matrix-users-created,start" extra_args)
|
|
|
|
|
2023-03-19 08:12:37 +02:00
|
|
|
# Runs installation tasks for a single service
|
2023-03-20 15:05:19 +02:00
|
|
|
install-service service *extra_args:
|
2023-03-28 09:55:11 +02: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-19 08:12:37 +02:00
|
|
|
|
2023-01-11 15:05:49 +02:00
|
|
|
# Runs the playbook with --tags=setup-all,ensure-matrix-users-created,start and optional arguments
|
|
|
|
setup-all *extra_args: (run-tags "setup-all,ensure-matrix-users-created,start" extra_args)
|
|
|
|
|
|
|
|
# Runs the playbook with the given list of arguments
|
|
|
|
run +extra_args:
|
2023-04-01 05:34:59 +02:00
|
|
|
ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
|
2023-01-11 15:05:49 +02:00
|
|
|
|
|
|
|
# Runs the playbook with the given list of comma-separated tags and optional arguments
|
|
|
|
run-tags tags *extra_args:
|
2023-03-25 17:47:13 +02:00
|
|
|
just --justfile {{ justfile() }} run --tags={{ tags }} {{ extra_args }}
|
2023-01-11 15:05:49 +02:00
|
|
|
|
|
|
|
# Runs the playbook in user-registration mode
|
|
|
|
register-user username password admin_yes_or_no *extra_args:
|
2023-04-01 05:34:59 +02:00
|
|
|
ansible-playbook -i inventory/hosts setup.yml --tags=register-user --extra-vars="username={{ username }} password={{ password }} admin={{ admin_yes_or_no }}" {{ extra_args }}
|
2023-01-11 15:05:49 +02: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 17:47:13 +02:00
|
|
|
@just --justfile {{ justfile() }} run-tags start-group --extra-vars="group={{ group }}" {{ extra_args }}
|
2023-01-11 15:05:49 +02: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 17:47:13 +02:00
|
|
|
@just --justfile {{ justfile() }} run-tags stop-group --extra-vars="group={{ group }}" {{ extra_args }}
|
2024-02-19 10:13:36 +02:00
|
|
|
|
|
|
|
# Rebuilds the mautrix-meta-instagram Ansible role using the mautrix-meta-messenger role as a source
|
|
|
|
rebuild-mautrix-meta-instagram:
|
|
|
|
/bin/bash {{ justfile_directory() }}/bin/rebuild-mautrix-meta-instagram.sh {{ justfile_directory() }}/roles/custom
|