Skip to content

Instantly share code, notes, and snippets.

@tjtoml
Created July 9, 2020 14:16
Show Gist options
  • Save tjtoml/9e396213805c6775d44269770fef70d2 to your computer and use it in GitHub Desktop.
Save tjtoml/9e396213805c6775d44269770fef70d2 to your computer and use it in GitHub Desktop.
Variables in conditional
- name: Apply the .sql scripts to create the database tables
postgresql_query:
db: vendor-{{ item.0.name }}-{{ item.0.cust_num }}
path_to_script: "{{ item.1.path }}"
loop: "{{ vendor_sites|product(table_scripts.files)|list }}"
loop_control:
label: "{{ item.0.name }}-{{ item.0.cust_num }} - {{ item.1.path|regex_search('[^/]*$') }}"
when: table-{{ item.0.name }}-{{ item.0.cust_num }}-{{ item.1.path|regex_search('[^/]*$') }} not in db_flag_files.files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment