Skip to content

Commit

Permalink
Change extra connections loop logic
Browse files Browse the repository at this point in the history
To be compatible with python3 and also airflow cli syntax
  • Loading branch information
diraol committed Jun 10, 2023
1 parent aad1580 commit f438b70
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit f438b70

Please sign in to comment.