Create requirements.yml based on a template (requirements.all.yml)
In the future, we'll also have optional optimization steps, which could trim down `requirements.yml` based on the components being used.
This commit is contained in:
parent
8ee20f69a6
commit
e2132a3c51
2 changed files with 13 additions and 6 deletions
15
justfile
15
justfile
|
@ -3,10 +3,10 @@ default:
|
||||||
@just --list --justfile {{ justfile() }}
|
@just --list --justfile {{ justfile() }}
|
||||||
|
|
||||||
# Pulls external Ansible roles
|
# Pulls external Ansible roles
|
||||||
roles:
|
roles: requirements-yml
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
if [ -x "$(command -v agru)" ]; then
|
if [ -x "$(command -v agru)" ]; then
|
||||||
agru
|
agru -r {{ justfile_directory() }}/requirements.yml
|
||||||
else
|
else
|
||||||
rm -rf roles/galaxy
|
rm -rf roles/galaxy
|
||||||
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
||||||
|
@ -14,7 +14,7 @@ roles:
|
||||||
|
|
||||||
# Updates requirements.yml if there are any new tags available. Requires agru
|
# Updates requirements.yml if there are any new tags available. Requires agru
|
||||||
update: && opml
|
update: && opml
|
||||||
@agru -u
|
@agru -r {{ justfile_directory() }}/requirements.all.yml -u
|
||||||
|
|
||||||
# Runs ansible-lint against all roles in the playbook
|
# Runs ansible-lint against all roles in the playbook
|
||||||
lint:
|
lint:
|
||||||
|
@ -39,7 +39,7 @@ install-service service *extra_args:
|
||||||
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: requirements-yml
|
||||||
ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
|
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
|
||||||
|
@ -59,3 +59,10 @@ 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 }}
|
||||||
|
|
||||||
|
# Prepares the requirements.yml file
|
||||||
|
requirements-yml:
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
if [ ! -f "{{ justfile_directory() }}/requirements.yml" ]; then
|
||||||
|
cp {{ justfile_directory() }}/requirements.all.yml {{ justfile_directory() }}/requirements.yml
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue