Tweaks for DAG-related items.
Validate DAGs / validate (push) Failing after 1m4s

This commit is contained in:
2025-09-13 22:02:24 -04:00
parent 06a1ee8f78
commit 99cb109fb4
2 changed files with 14 additions and 6 deletions
+1
View File
@@ -44,6 +44,7 @@ jobs:
- name: Install dagu - name: Install dagu
run: | run: |
curl -L https://raw.githubusercontent.com/dagu-org/dagu/main/scripts/installer.sh | bash curl -L https://raw.githubusercontent.com/dagu-org/dagu/main/scripts/installer.sh | bash
dagu version
- name: Validate DAGs - name: Validate DAGs
run: | run: |
+13 -6
View File
@@ -5,6 +5,7 @@
gather_facts: false gather_facts: false
vars: vars:
# Hardcoded fallback for DAGs path
dags_path: "{{ playbook_dir ~ '/../app-configs/rinoa/dagu/dags' }}" dags_path: "{{ playbook_dir ~ '/../app-configs/rinoa/dagu/dags' }}"
vault_addr: "{{ lookup('env', 'VAULT_ADDR') }}" vault_addr: "{{ lookup('env', 'VAULT_ADDR') }}"
vault_token: "{{ lookup('env', 'VAULT_TOKEN') }}" vault_token: "{{ lookup('env', 'VAULT_TOKEN') }}"
@@ -12,7 +13,11 @@
tasks: tasks:
- name: Build list of DAG template files - name: Build list of DAG template files
ansible.builtin.set_fact: ansible.builtin.set_fact:
dag_templates: "{{ lookup('fileglob', dags_path ~ '/*.yaml.j2', wantlist=True) }}" dag_templates: >-
{{
lookup('ansible.builtin.fileglob', dags_path ~ '/*.yaml.j2', wantlist=True)
| default([])
}}
- name: Pre-check Vault secrets in templates - name: Pre-check Vault secrets in templates
when: dag_templates | length > 0 when: dag_templates | length > 0
@@ -21,11 +26,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
vault_keys: >- vault_keys: >-
{{ {{
dag_templates (
| map('lookup', 'file', wantlist=True) dag_templates
| map('regex_findall', | map('file', 'r')
"lookup\\('community.hashi_vault.vault_kv2_get',\\s*'[^']+',\\s*engine_mount_point='[^']+',\\s*url=[^,]+,\\s*token=[^\\)]+\\)\\['secret'\\]\\['([^']+)'\\]") | map('regex_findall',
| sum(start=[]) "lookup\\('community.hashi_vault.vault_kv2_get',\\s*'[^']+',\\s*engine_mount_point='[^']+',\\s*url=[^,]+,\\s*token=[^\\)]+\\)\\['secret'\\]\\['([^']+)'\\]")
| list
) | default([])
}} }}
- name: Warn if any Vault keys might be missing - name: Warn if any Vault keys might be missing