Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
2.2 KiB

  1. # Shows help
  2. default:
  3. @just --list --justfile {{ justfile() }}
  4. # Pulls external Ansible roles
  5. roles:
  6. #!/usr/bin/env sh
  7. set -euo pipefail
  8. if [ -x "$(command -v agru)" ]; then
  9. agru
  10. else
  11. rm -rf roles/galaxy
  12. ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
  13. fi
  14. # Updates requirements.yml if there are any new tags available. Requires agru
  15. update:
  16. @agru -u
  17. # Runs ansible-lint against all roles in the playbook
  18. lint:
  19. ansible-lint
  20. # Runs the playbook with --tags=install-all,ensure-matrix-users-created,start and optional arguments
  21. install-all *extra_args: (run-tags "install-all,ensure-matrix-users-created,start" extra_args)
  22. # Runs installation tasks for a single service
  23. install-service service *extra_args:
  24. just --justfile {{ justfile() }} run --tags=install-{{ service }},start-group --extra-vars=group={{ service }} {{ extra_args }}
  25. # Runs the playbook with --tags=setup-all,ensure-matrix-users-created,start and optional arguments
  26. setup-all *extra_args: (run-tags "setup-all,ensure-matrix-users-created,start" extra_args)
  27. # Runs the playbook with the given list of arguments
  28. run +extra_args:
  29. time ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
  30. # Runs the playbook with the given list of comma-separated tags and optional arguments
  31. run-tags tags *extra_args:
  32. just --justfile {{ justfile() }} run --tags={{ tags }} {{ extra_args }}
  33. # Runs the playbook in user-registration mode
  34. register-user username password admin_yes_or_no *extra_args:
  35. time ansible-playbook -i inventory/hosts setup.yml --tags=register-user --extra-vars="username={{ username }} password={{ password }} admin={{ admin_yes_or_no }}" {{ extra_args }}
  36. # Starts all services
  37. start-all *extra_args: (run-tags "start-all" extra_args)
  38. # Starts a specific service group
  39. start-group group *extra_args:
  40. @just --justfile {{ justfile() }} run-tags start-group --extra-vars="group={{ group }}" {{ extra_args }}
  41. # Stops all services
  42. stop-all *extra_args: (run-tags "stop-all" extra_args)
  43. # Stops a specific service group
  44. stop-group group *extra_args:
  45. @just --justfile {{ justfile() }} run-tags stop-group --extra-vars="group={{ group }}" {{ extra_args }}