format justfile, safely integrate agru
This commit is contained in:
parent
d5b1c3fb84
commit
9e3069277d
1 changed files with 15 additions and 9 deletions
24
justfile
24
justfile
|
@ -1,44 +1,50 @@
|
||||||
# Shows help
|
# Shows help
|
||||||
default:
|
default:
|
||||||
@just --list --justfile {{ justfile() }}
|
@just --list --justfile {{ justfile() }}
|
||||||
|
|
||||||
# Pulls external Ansible roles
|
# Pulls external Ansible roles
|
||||||
roles:
|
roles:
|
||||||
rm -rf roles/galaxy
|
#!/usr/bin/env bash
|
||||||
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
set -euo pipefail
|
||||||
|
if [ -x "$(command -v agru)" ]; then
|
||||||
|
agru
|
||||||
|
else
|
||||||
|
rm -rf roles/galaxy
|
||||||
|
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
||||||
|
fi
|
||||||
|
|
||||||
# Runs ansible-lint against all roles in the playbook
|
# Runs ansible-lint against all roles in the playbook
|
||||||
lint:
|
lint:
|
||||||
ansible-lint
|
ansible-lint
|
||||||
|
|
||||||
# Runs the playbook with --tags=install-all,start and optional arguments
|
# Runs the playbook with --tags=install-all,start and optional arguments
|
||||||
install-all *extra_args: (run-tags "install-all,start" extra_args)
|
install-all *extra_args: (run-tags "install-all,start" extra_args)
|
||||||
|
|
||||||
# Runs installation tasks for a single service
|
# Runs installation tasks for a single service
|
||||||
install-service service *extra_args:
|
install-service service *extra_args:
|
||||||
just --justfile {{ justfile() }} run --tags=install-{{ service }},start-group --extra-vars=group={{ service }} {{ extra_args }}
|
just --justfile {{ justfile() }} run --tags=install-{{ service }},start-group --extra-vars=group={{ service }} {{ extra_args }}
|
||||||
|
|
||||||
# Runs the playbook with --tags=setup-all,start and optional arguments
|
# Runs the playbook with --tags=setup-all,start and optional arguments
|
||||||
setup-all *extra_args: (run-tags "setup-all,start" extra_args)
|
setup-all *extra_args: (run-tags "setup-all,start" extra_args)
|
||||||
|
|
||||||
# Runs the playbook with the given list of arguments
|
# Runs the playbook with the given list of arguments
|
||||||
run +extra_args:
|
run +extra_args:
|
||||||
time ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
|
time ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
|
||||||
|
|
||||||
# Runs the playbook with the given list of comma-separated tags and optional arguments
|
# Runs the playbook with the given list of comma-separated tags and optional arguments
|
||||||
run-tags tags *extra_args:
|
run-tags tags *extra_args:
|
||||||
just --justfile {{ justfile() }} run --tags={{ tags }} {{ extra_args }}
|
just --justfile {{ justfile() }} run --tags={{ tags }} {{ extra_args }}
|
||||||
|
|
||||||
# Starts all services
|
# Starts all services
|
||||||
start-all *extra_args: (run-tags "start-all" extra_args)
|
start-all *extra_args: (run-tags "start-all" extra_args)
|
||||||
|
|
||||||
# Starts a specific service group
|
# Starts a specific service group
|
||||||
start-group group *extra_args:
|
start-group group *extra_args:
|
||||||
@just --justfile {{ justfile() }} run-tags start-group --extra-vars="group={{ group }}" {{ extra_args }}
|
@just --justfile {{ justfile() }} run-tags start-group --extra-vars="group={{ group }}" {{ extra_args }}
|
||||||
|
|
||||||
# Stops all services
|
# Stops all services
|
||||||
stop-all *extra_args: (run-tags "stop-all" extra_args)
|
stop-all *extra_args: (run-tags "stop-all" extra_args)
|
||||||
|
|
||||||
# Stops a specific service group
|
# Stops a specific service group
|
||||||
stop-group group *extra_args:
|
stop-group group *extra_args:
|
||||||
@just --justfile {{ justfile() }} run-tags stop-group --extra-vars="group={{ group }}" {{ extra_args }}
|
@just --justfile {{ justfile() }} run-tags stop-group --extra-vars="group={{ group }}" {{ extra_args }}
|
||||||
|
|
Loading…
Reference in a new issue