Treat omitted host_apps.enabled as true so deploy works (#35).
Sync runner checkout / sync (pull_request) Successful in 7s

rejectattr('enabled') raised on every row that omitted the key, which
blocked all app deploys after #33 — including url_shortening_service.
This commit is contained in:
2026-09-16 10:20:48 -05:00
parent 726ad971cb
commit 08ea6dfb08
3 changed files with 26 additions and 4 deletions
+12 -2
View File
@@ -35,14 +35,24 @@
- app_env is defined
- matching_host_apps | length == 0
# rejectattr('enabled', …) raises when the key is omitted. Omit = enabled (#35).
- name: Reset deploy targets
ansible.builtin.set_fact:
deploy_targets: []
- name: "Drop disabled host_apps (enabled: false)"
ansible.builtin.set_fact:
deploy_targets: "{{ matching_host_apps | rejectattr('enabled', 'equalto', false) | list }}"
deploy_targets: "{{ deploy_targets + [item] }}"
loop: "{{ matching_host_apps }}"
when: item.enabled | default(true)
loop_control:
label: "{{ item.name }}/{{ item.env }}"
- name: Show skipped disabled apps
ansible.builtin.debug:
msg: "skip disabled {{ item.name }}/{{ item.env }} on {{ inventory_hostname }}"
loop: "{{ matching_host_apps | selectattr('enabled', 'equalto', false) | list }}"
loop: "{{ matching_host_apps }}"
when: not (item.enabled | default(true))
loop_control:
label: "{{ item.name }}/{{ item.env }}"