Fail loud when deploy --app matches nothing #6
@@ -24,6 +24,29 @@
|
|||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "ref={{ app_ref | default('(per-app default branch)') }} targets={{ deploy_targets | map(attribute='name') | zip(deploy_targets | map(attribute='env')) | list }}"
|
msg: "ref={{ app_ref | default('(per-app default branch)') }} targets={{ deploy_targets | map(attribute='name') | zip(deploy_targets | map(attribute='env')) | list }}"
|
||||||
|
|
||||||
|
# Explicit --app/--env with no host_apps match used to silently no-op Django
|
||||||
|
# and still refresh web-static (looked like a "static-only" deploy). Fail loud.
|
||||||
|
- name: Fail when requested app+env is not on this host
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-
|
||||||
|
No host_apps entry for app={{ app }} env={{ app_env }} on
|
||||||
|
{{ inventory_hostname }}. Check inventory/host_vars and app_catalog
|
||||||
|
(django apps need type: django + compose_file). Catalog keys:
|
||||||
|
{{ app_catalog.keys() | list }}.
|
||||||
|
when:
|
||||||
|
- app is defined
|
||||||
|
- app_env is defined
|
||||||
|
- deploy_targets | length == 0
|
||||||
|
|
||||||
|
- name: Fail when requested app missing from app_catalog
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-
|
||||||
|
app={{ app }} is not in app_catalog. Add it with type: django (docker)
|
||||||
|
or type: node-static. Known: {{ app_catalog.keys() | list }}.
|
||||||
|
when:
|
||||||
|
- app is defined
|
||||||
|
- app not in app_catalog
|
||||||
|
|
||||||
- name: Deploy Django (docker compose) apps
|
- name: Deploy Django (docker compose) apps
|
||||||
ansible.builtin.include_tasks: django.yml
|
ansible.builtin.include_tasks: django.yml
|
||||||
loop: "{{ deploy_targets | selectattr('name', 'in', django_names) | list }}"
|
loop: "{{ deploy_targets | selectattr('name', 'in', django_names) | list }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user