From f438b70e481c618d5e78f0a60a0d63a55dfe3c4b Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Tue, 3 Jan 2023 13:38:38 -0300 Subject: [PATCH] Change extra connections loop logic To be compatible with python3 and also airflow cli syntax --- tasks/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/config.yml b/tasks/config.yml index 35f4207..6277eb7 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -121,8 +121,11 @@ - name: Airflow | Add connections from configuration file command: "{{ airflow_executable }} connections add \ - {% for key, value in item.iteritems() %}--{{ key }} '{{ value }}' \ - {% endfor %}" + {% for key, value in item.items() %} \ + {% if key == 'conn_id' %} {{value}} \ + {% else %} --{{ key | replace('_', '-') }} '{{ value }}' \ + {% endif %} \ + {% endfor %}" become: true become_user: "{{ airflow_user }}" with_items: "{{ airflow_admin_connections }}"