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.
 
 

45 line
1.7 KiB

  1. # Shows help
  2. default:
  3. @just --list --justfile {{ justfile() }}
  4. # Pulls external Ansible roles
  5. roles:
  6. rm -rf roles/galaxy
  7. ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
  8. # Runs ansible-lint against all roles in the playbook
  9. lint:
  10. ansible-lint
  11. # Runs the playbook with --tags=install-all,ensure-matrix-users-created,start and optional arguments
  12. install-all *extra_args: (run-tags "install-all,ensure-matrix-users-created,start" extra_args)
  13. # Runs the playbook with --tags=setup-all,ensure-matrix-users-created,start and optional arguments
  14. setup-all *extra_args: (run-tags "setup-all,ensure-matrix-users-created,start" extra_args)
  15. # Runs the playbook with the given list of arguments
  16. run +extra_args:
  17. time ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
  18. # Runs the playbook with the given list of comma-separated tags and optional arguments
  19. run-tags tags *extra_args:
  20. just --justfile {{ justfile() }} run --tags={{ tags }} {{ extra_args }}
  21. # Runs the playbook in user-registration mode
  22. register-user username password admin_yes_or_no *extra_args:
  23. time ansible-playbook -i inventory/hosts setup.yml --tags=register-user --extra-vars="username={{ username }} password={{ password }} admin={{ admin_yes_or_no }}" {{ extra_args }}
  24. # Starts all services
  25. start-all *extra_args: (run-tags "start-all" extra_args)
  26. # Starts a specific service group
  27. start-group group *extra_args:
  28. @just --justfile {{ justfile() }} run-tags start-group --extra-vars="group={{ group }}" {{ extra_args }}
  29. # Stops all services
  30. stop-all *extra_args: (run-tags "stop-all" extra_args)
  31. # Stops a specific service group
  32. stop-group group *extra_args:
  33. @just --justfile {{ justfile() }} run-tags stop-group --extra-vars="group={{ group }}" {{ extra_args }}